help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to find encoding violations in Emacs buffer?


From: B. T. Raven
Subject: Re: how to find encoding violations in Emacs buffer?
Date: Tue, 12 Dec 2006 17:45:15 -0600

"Lennart Borgman" <address@hidden> wrote in message
news:address@hidden
> address@hidden wrote:
> > Hello,
> >
> > from time to time, a buffer gets some spurious character in and Emacs
> > refuses to save it in the correct encoding. So I am presented with the
> > choice of other different encodings.
> >
> > However, in most of the cases, I know that the file *should* be UTF-8
> > encoded.  So I would rather like to find out where the offending
> > character is and correct it, instead of choosing a different encoding.
> >
> > Is there any function/package/elisp hack to find/highlight characters
> > in a buffer that Emacs could not encode as UTF-8?
> >
> > Thank you for any hint!
> >
> > Riccardo
> >
> > P.S. Currently running 22.0.90
> >
>
> I think someone said there was, but I have never seen it though I have
> had these problem quite often. Can't remember the details now.
>
> Which platform are you on? I am using MS Windows (2000 or XP).
>
>

I also use utf-8 almost all the time (dos coding system for text files to
be used in the w32 environment, e.g. batch files, etc.) For files written
by and read back into w32 Emacs,  I think that it's important to
distinguish between characters that are not displayed  due to the lack of
a glyph in the font(s) [shown as hollow rectangles, solid rhombs, question
marks] and those missing because of some incompatibility between character
mappings [I think these are shown as escaped octal sequences that result
from differences in national character sets in the range just above ascii
(128-255)]. I have always been able to fix these with M-%. If you can find
tables of these extended characters from the various European languages,
it should be fairly easy for someone (not me) to cobble together an elisp
routine to deal with this problem. I would guess that 10 or 20 of these
characters account for more than 99% of the mismappings.

Ed



reply via email to

[Prev in Thread] Current Thread [Next in Thread]