Subject: Re: NT Emacs, message-mode and 8 bit characters...

From: Andrew Innes <[email-masked]>
Date: Wed, 14 Oct 1998 13:26:00 +0100 (BST)

On 13 Oct 1998 17:30:53 +0100, John S Cooper <[email-masked]> said:
>The following message is a courtesy copy of an article
>that has been posted to gnu.emacs.gnus as well.
>
>
>I recently upgraded to NT Emacs 20.3.1 and pgnus v0.34, and found that when I
>attempted to enter 8 bit latin-1 characters into my mail messages (using
>iso-acc.el), the 8th bit seemed to be getting stripped.
>
>Calling standard-display-european didn't help.
>
>The *mail* buffer modeline started "-1:" which apparently signifies the buffer
>is using a latin-1 coding system; I therefore would have expected 8 bit chars
>to be displayed properly.
>
>I was able to enter 8 bit chars into other buffers that didn't have the "-1:"
>modeline designation.
>
>After some experimentation, I finally found that adding `(set-buffer-multibyte
>nil)' to my message-mode-hook enabled me to enter 8 bit chars.

I believe the problem here is simply that the redisplay support on
Windows in 20.3 is not fully MULE aware.  The situation should be much
better in 20.4.

When MULE is enabled (and it sounds like pgnus is turning it on
specifically for its own buffers, overriding the effect of
standard-display-european which turns it off), non-ascii characters are
stored as multiple bytes in Emacs, and the display code is responsible
for interpreting the internal representation and displaying them
correctly.  In 20.3, NT-Emacs doesn't try to handle the charset property
of multibyte characters, and ends up displaying iso-latin-1 characters
as ascii (ie. with the high bit stripped, as you noticed).

If you type `C-x =' when positioned over such a character like "é" (e
with acute accent), you should see that Emacs thinks the character is
0x8e9 (0x8?? indicates iso-latin-1), even though it is displaying as the
ascii character "i" (0x69).

By calling (set-buffer-multibyte nil), you override pgnus and force MULE
off for the message buffer; with MULE off, the redisplay code works
properly.  (If you now type `C-x =' on é, the character value should be
the expected iso-latin-1 codepage value 0xe9.)

AndrewI