emacs-devel
[Top][All Lists]
Advanced

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

Re: iso-8859-1 and non-latin-1 chars


From: Stefan Monnier
Subject: Re: iso-8859-1 and non-latin-1 chars
Date: Thu, 07 Nov 2002 18:58:50 -0500

> In article <address@hidden>, "Stefan Monnier" <monnier+gnu/address@hidden> 
> writes:
> 
> >>  > When encoding text containing non-latin-1 chars with the latin-1
> >>  > coding-system, they get output as some kind of escape sequence.
> >>  
> >>  Yes.  IIRC, this is hard-coded in the encoder's C code: it works as if
> >>  latin-1 was actually iso-latin-1-wth-esc.
> 
> > How can we change that ?
> 
> This change will do.
> 
> *** european.el.~1.75.~       Wed Nov  6 09:13:16 2002
> --- european.el       Fri Nov  8 08:32:12 2002
> ***************
> *** 36,42 ****
>    'iso-latin-1 2 ?1
>    "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)."
>    '(ascii latin-iso8859-1 nil nil
> !    nil nil nil nil nil nil nil nil nil nil nil nil t)
>    '((safe-charsets ascii latin-iso8859-1)
>      (mime-charset . iso-8859-1)))
>   
> --- 36,42 ----
>    'iso-latin-1 2 ?1
>    "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)."
>    '(ascii latin-iso8859-1 nil nil
> !    nil nil nil nil nil nil nil nil nil nil nil t t)
>    '((safe-charsets ascii latin-iso8859-1)
>      (mime-charset . iso-8859-1)))
>   
> Or, if this is a problem only for ispell, we can make series
> of "safe" coding-systems for ispell.

I think the problem is only known to bite ispell, but I doubt there
are many other applications that need to (or try to) encode a piece
of text with unsafe chars, so the above patch should be safe.

I also think the patch is correct since it otherwise outputs code
that are not part of latin-1, strictly speaking.  If you want such
a behavior, you should use iso-latin-1-with-esc.

The same patch should also be applied for other iso8859-N charsets
I suppose.

> Or, we can add a global flag, say
> `inhibit-unsafe-iso-escape, to tell encoding routine not to
> produces those escape sequences.  Then, ispell can let-bind
> that variable to t on encoding.

That seems overkill since you can use iso-latin-1-with-esc instead.
But it would save us from changing all the coding-systems.


        Stefan





reply via email to

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