[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Encoding help
From: |
Eli Zaretskii |
Subject: |
Re: Encoding help |
Date: |
Mon, 01 Jun 2009 19:05:56 -0400 |
> Date: Mon, 01 Jun 2009 11:51:13 -0500
> From: "B. T. Raven" <nihil@nihilo.net>
> Newsgroups: gnu.emacs.help
>
> I have a file created by saving a pdf as text and I want to convert the
> whole thing to utf-8 encoding. If I force the encoding for save in Emacs
> 23.0 to utf-8 I get the following in a *Warning* buffer:
>
> These default coding systems were tried to encode text
> in the buffer `span.txt':
> (utf-8-dos (122 . 4194285) (165 . 4194257) (204 . 4194285) (253
> . 4194257) (292 . 4194285) (372 . 4194289) (410 . 4194285) (418
> . 4194285) (653 . 4194217) (689 . 4194285) (731 . 4194285))
> (iso-latin-1-dos (122 . 4194285) (165 . 4194257) (204 . 4194285)
> (253 . 4194257) (292 . 4194285) (372 . 4194289) (410 . 4194285) (418
> . 4194285) (653 . 4194217) (689 . 4194285) (731 . 4194285))
> However, each of them encountered characters it couldn't encode:
>
> [Below are many dozens of \xxx octal escape sequences]
>
> utf-8-dos cannot encode these: ...
> iso-latin-1-dos cannot encode these: ...
>
> The original pdf shows many standard diacritics for Romance languages
> along with a few vowels with macrons.
It sounds like the original text file is already in UTF-8. Does it
help to visit it with "C-x RET c utf-8 RET C-x C-f" instead of just
"C-x C-f"?
If that doesn't help (i.e. if you don't see diacritics instead of
octal escapes), then can you find out how the files is encoded?
Going to one of the octal escapes and typing "C-u C-x =" might also
give important hints, so please post the result here.
> If my only option is to Search and Replace these escape sequences
> with Unicode characters, how can I get a list of all these bad
> characters (they all show in red in Emacs 23 anyway).
You can try using the functions unencodable-char-position and
find-coding-systems-region to find these characters.
> Has any of you written routines to replace things like these using a
> list of dotted pairs or something similar?
Given the wealth of encodings supported by Emacs, such replacements
should not be necessary. Instead, try to find out how the file is
encoded, and visit it by instructing Emacs to use that encoding, with
"C-x RET c".
- Encoding help, B. T. Raven, 2009/06/01
- Re: Encoding help,
Eli Zaretskii <=
- Message not available