Subject: Re: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page

From: Daniel Colascione <[email-masked]>
Date: Thu, 25 Oct 2012 14:18:07 -0700

On 10/23/2012 9:22 AM, Eli Zaretskii wrote:
>> Date: Tue, 23 Oct 2012 22:05:46 +0900
>> From: Kazuhiro Ito <[email-masked]>
>> Cc: [email-masked]
>>
>> On Cygwin, locale-coding-system's value depends on its environment.
>> For example,
>>
>> $ env LANG=ja_JP.CP932 emacs --batch --eval '(princ locale-coding-system)'
>> -> japanese-cp932-unix
>>
>> $ env LANG=ja_JP.UTF-8 emacs --batch --eval '(princ locale-coding-system)'
>> -> utf-8-unix
> 
> This is not necessarily relevant to Emacs, or at least doesn't provide
> a definitive answer to the question what encoding should ENCODE_SYSTEM
> use in the cygw32 build, which is a kind of androgen wrt encoding and
> decoding issues.
> 
> There are several places where this issue might (or will) pop up:
> 
>   . decoding keyboard key events

Already handled, I believe.

>   . encoding and decoding file names

We talk to Cygwin here, so there's no problem using locale-coding-system.

>   . encoding strings passed to various non-file APIs, like the one you
>     mentioned

I tried to ferret these out what I was doing the initial port, but it looks like
I missed the font code.

> 
> At least the first 2 items use different single-byte encoding in the
> GUI and the console frames.
> 
> Someone(TM) should analyze all these and come up with recommendations
> whether cygw32 should cater to the normal Cygwin locale, or maybe for
> practical reasons it should do something else.

The right code for Cygw32 is to always define NTGUI_UNICODE and unconditionally
use Unicode APIs when NTGUI_UNICODE is set. Maybe, someday, we can define
NTGUI_UNICODE for the NT port too.