all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "B. T. Raven" <ecinmn@alcisp.com>
Subject: Re: how to find encoding violations in Emacs buffer?
Date: Tue, 12 Dec 2006 17:45:15 -0600	[thread overview]
Message-ID: <a0be7$457f3f1d$49fa663$21032@DIALUPUSA.NET> (raw)
In-Reply-To: mailman.1801.1165956001.2155.help-gnu-emacs@gnu.org


"Lennart Borgman" <lennart.borgman.073@student.lu.se> wrote in message
news:mailman.1801.1165956001.2155.help-gnu-emacs@gnu.org...
> riccardo.murri@gmail.com 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

  parent reply	other threads:[~2006-12-12 23:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 18:18 how to find encoding violations in Emacs buffer? riccardo.murri
2006-12-12 20:39 ` Lennart Borgman
2006-12-12 20:56   ` Riccardo Murri
     [not found] ` <mailman.1801.1165956001.2155.help-gnu-emacs@gnu.org>
2006-12-12 23:45   ` B. T. Raven [this message]
2006-12-13  4:26 ` Eli Zaretskii
     [not found] ` <mailman.1814.1165984004.2155.help-gnu-emacs@gnu.org>
2006-12-13  8:39   ` riccardo.murri
2006-12-13 10:45     ` Peter Dyballa
     [not found]     ` <mailman.1823.1166006732.2155.help-gnu-emacs@gnu.org>
2006-12-13 12:34       ` riccardo.murri
2006-12-13 12:55         ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='a0be7$457f3f1d$49fa663$21032@DIALUPUSA.NET' \
    --to=ecinmn@alcisp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.