Subject: Font tables with localized Win-NT (german)

From: Martin Guddat <[email-masked]>
Date: Mon, 3 Feb 1997 13:57:04 +0100

Hello to all,

I am am not quite sure if my question is a special NT question or a general one. I simply try to get an answer here from some of these kind people ;-)

I am using a localized german version of Windows NT. So I can have spacial german characters in my filenames. Due to a long time of computing I don't use them. But the system gives me the shell error messages in german also. When Emacs prints these message I get something like this:

-------------- snip -----------------------------------------
dir xx
Datentr\204ger in Laufwerk C: ist IBM-DORS
Datentr\204gernummer: 1C24-D56F

Verzeichnis von c:\WINNT\Profiles\Guddat\Desktop

Datei nicht gefunden
-------------- snip -----------------------------------------

The \204 should be the german ä (a combination: ae) standard-display-european does not help.

How can I fix this?

Thanks for your help,

Martin Guddat

---------------------------------------------------------------------------
Dipl.-Ing. Martin Guddat    Universitaet Duisburg
Fachbereich Maschinenbau    Lotharstrasse 1          Tel: +49-203-379-3059
Fachgebiet Mechanik         47048 Duisburg           Fax: +49-203-379-2494

---

From: [email-masked] (Jan Dubois)
Date: Mon, 03 Feb 1997 19:14:23 GMT

On Mon, 3 Feb 1997 13:57:04 +0100, you wrote:

>Hello to all,
>
>I am am not quite sure if my question is a special NT question or a general one. 
>I simply try to get an answer here from some of these kind people ;-)
>
>I am using a localized german version of Windows NT. So I can have spacial german 
>characters in my filenames. Due to a long time of computing I don't use them. But
>the system gives me the shell error messages in german also. When Emacs prints 
>these message I get something like this:
>

Martin,

put the following into your ~/.emacs:

;; Display characters 128 through 254 as-is.  Without this
;; statement, octal notation is used for these characters.
(standard-display-8bit 128 254)

Regards,
Jan

---

From: Andrew Innes <[email-masked]>
Date: Mon, 3 Feb 1997 19:01:44 GMT

On Mon, 3 Feb 1997 13:57:04 +0100, Martin Guddat <[email-masked]> said:
>Hello to all,
>
>I am am not quite sure if my question is a special NT question or a
>general one. I simply try to get an answer here from some of these kind
>people ;-)
>
>I am using a localized german version of Windows NT. So I can have
>spacial german characters in my filenames. Due to a long time of
>computing I don't use them. But the system gives me the shell error
>messages in german also. When Emacs prints these message I get something
>like this:
>

The messages printed by the shell (or other command-line programs that
are properly localized) are being output in OEM encoding, whereas Emacs
and most other Windows programs display text in fonts that use the ANSI
encoding (roughly corresponding to isolatin-1 in this case).

In most systems, these two encodings (codepages) are different.  Even
though both codepages may contain more-or-less the same characters (at
least the same set of accented characters), many of them are at
different codepoints in the two codepages.

There are several possible solutions to this problem:

 - run your shell buffer in a separate frame and select a font for that
   frame which uses the OEM encoding (eg. Terminal).

 - add a function to `comint-output-filter-functions' in the shell
   buffer which translates text recevied from subprocesses from OEM to
   ANSI encoding.  (You will need to contruct a mapping table yourself
   to do this.)

 - change the buffer-display-table for the shell buffer to change
   encoding on the fly (as the buffer contents are drawn on the
   screen).  You need the same table as for the second option.

The last two options can generally only perform imperfect translation,
since most OEM codepages contain characters that aren't present in the
ANSI codepage.  However, for accented letters and such, translation is
straightforward.

The advantage of the second method is that you can paste text taken from
the shell buffer into other buffers and it will display correctly.  The
other two methods only display the text correctly when in that frame or
buffer.

AndrewI

PS. I should mention that command-line (aka console) programs on Windows
95 and NT also use the OEM encoding for filenames, while Windows
programs normally use the ANSI encoding.  This is relevant if you use
non-ascii characters in filenames, and then run subprocesses passing the
names of files on the command-line.

Also note that all text typed to Emacs is received in the ANSI encoding,
regardless of the font selected or anything else.

AndrewI