GNU bug report logs - #12693
[cygwin] Setting fonts with non-ascii names throws error

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Kazuhiro Ito <kzhr@HIDDEN>; dated Sat, 20 Oct 2012 21:49:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Changed bug title to '[cygwin] Setting fonts with non-ascii names throws error' from '24.2.50; src/w32font.c should depend on ANSI code page' Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
Removed tag(s) patch. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.

Message received at 12693 <at> debbugs.gnu.org:


Received: (at 12693) by debbugs.gnu.org; 26 Oct 2012 07:33:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 26 03:33:30 2012
Received: from localhost ([127.0.0.1]:34127 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TReQ5-0007Is-Td
	for submit <at> debbugs.gnu.org; Fri, 26 Oct 2012 03:33:30 -0400
Received: from mtaout20.012.net.il ([80.179.55.166]:49419)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eliz@HIDDEN>) id 1TReQ3-0007Ik-6m
	for 12693 <at> debbugs.gnu.org; Fri, 26 Oct 2012 03:33:28 -0400
Received: from conversion-daemon.a-mtaout20.012.net.il by
	a-mtaout20.012.net.il (HyperSendmail v2007.08) id
	<0MCH00400OTAOY00@HIDDEN> for
	12693 <at> debbugs.gnu.org; Fri, 26 Oct 2012 09:30:35 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0MCH0046KOUZ5ZC0@HIDDEN>;
	Fri, 26 Oct 2012 09:30:35 +0200 (IST)
Date: Fri, 26 Oct 2012 09:30:36 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page
In-reply-to: <5089AC8F.6000900@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Daniel Colascione <dancol@HIDDEN>
Message-id: <83fw51adwj.fsf@HIDDEN>
References: <87y5j0ddgj.wl%%xmue@HIDDEN> <87k3uhjthd.fsf@HIDDEN>
	<87a9vdgwyd.wl%%xmue@HIDDEN> <83y5ixb1l2.fsf@HIDDEN>
	<5089AC8F.6000900@HIDDEN>
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
	has
	identified this incoming email as possible spam. The original message
	has been attached to this so you can view it (if it isn't spam) or
	label similar future email.  If you have any questions, see
	the administrator of that system for details.
	Content preview:  > Date: Thu,
	25 Oct 2012 14:18:07 -0700 > From: Daniel Colascione
	<dancol@HIDDEN> > CC: Kazuhiro Ito <kzhr@HIDDEN>,
	12693 <at> debbugs.gnu.org
	> > The right code for Cygw32 is to always define NTGUI_UNICODE and
	unconditionally
	> use Unicode APIs when NTGUI_UNICODE is set. [...] 
	Content analysis details:   (1.5 points, 10.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,
	no trust [80.179.55.166 listed in list.dnswl.org]
	0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail)
	0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
	[score: 0.5000]
X-Debbugs-Envelope-To: 12693
Cc: kzhr@HIDDEN, 12693 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > Date: Thu, 25 Oct 2012 14:18:07 -0700 > From: Daniel Colascione
    <dancol@HIDDEN> > CC: Kazuhiro Ito <kzhr@HIDDEN>, 12693 <at> debbugs.gnu.org
    > > The right code for Cygw32 is to always define NTGUI_UNICODE and unconditionally
    > use Unicode APIs when NTGUI_UNICODE is set. [...] 
 
 Content analysis details:   (1.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
                             trust
                             [80.179.55.166 listed in list.dnswl.org]
  0.7 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
  0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
                             [score: 0.4859]

> Date: Thu, 25 Oct 2012 14:18:07 -0700
> From: Daniel Colascione <dancol@HIDDEN>
> CC: Kazuhiro Ito <kzhr@HIDDEN>, 12693 <at> debbugs.gnu.org
> 
> The right code for Cygw32 is to always define NTGUI_UNICODE and unconditionally
> use Unicode APIs when NTGUI_UNICODE is set.

I figured that much.  So I suggest that the patch to fix this issue be
reworked in that direction.

> Maybe, someday, we can define NTGUI_UNICODE for the NT port too.

That's the plan, yes.  Although I think it will not be a compile-time
test, since there's a lot of work involved, and so some old code will
have to coexist with the new for some time.  Volunteers are welcome.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12693; Package emacs,w32. Full text available.

Message received at 12693 <at> debbugs.gnu.org:


Received: (at 12693) by debbugs.gnu.org; 25 Oct 2012 21:20:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 25 17:20:25 2012
Received: from localhost ([127.0.0.1]:33792 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TRUqn-0001ul-6u
	for submit <at> debbugs.gnu.org; Thu, 25 Oct 2012 17:20:25 -0400
Received: from dancol.org ([96.126.100.184]:35309)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <dancol@HIDDEN>) id 1TRUqk-0001ud-JJ
	for 12693 <at> debbugs.gnu.org; Thu, 25 Oct 2012 17:20:23 -0400
Received: from c-76-22-66-162.hsd1.wa.comcast.net ([76.22.66.162]
	helo=[0.0.0.0])
	by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72) (envelope-from <dancol@HIDDEN>)
	id 1TRUoe-000050-TQ; Thu, 25 Oct 2012 14:18:13 -0700
Message-ID: <5089AC8F.6000900@HIDDEN>
Date: Thu, 25 Oct 2012 14:18:07 -0700
From: Daniel Colascione <dancol@HIDDEN>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:16.0) Gecko/20121010 Thunderbird/16.0.1
MIME-Version: 1.0
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page
References: <87y5j0ddgj.wl%%xmue@HIDDEN> <87k3uhjthd.fsf@HIDDEN>
	<87a9vdgwyd.wl%%xmue@HIDDEN> <83y5ixb1l2.fsf@HIDDEN>
In-Reply-To: <83y5ixb1l2.fsf@HIDDEN>
X-Enigmail-Version: 1.4.5
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enigD15F2F83A98301923307582F"
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 12693
Cc: Kazuhiro Ito <kzhr@HIDDEN>, 12693 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.1 (/)

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigD15F2F83A98301923307582F
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 10/23/2012 9:22 AM, Eli Zaretskii wrote:
>> Date: Tue, 23 Oct 2012 22:05:46 +0900
>> From: Kazuhiro Ito <kzhr@HIDDEN>
>> Cc: 12693 <at> debbugs.gnu.org
>>
>> On Cygwin, locale-coding-system's value depends on its environment.
>> For example,
>>
>> $ env LANG=3Dja_JP.CP932 emacs --batch --eval '(princ locale-coding-sy=
stem)'
>> -> japanese-cp932-unix
>>
>> $ env LANG=3Dja_JP.UTF-8 emacs --batch --eval '(princ locale-coding-sy=
stem)'
>> -> utf-8-unix
>=20
> 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.
>=20
> There are several places where this issue might (or will) pop up:
>=20
>   . 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 loo=
ks like
I missed the font code.

>=20
> At least the first 2 items use different single-byte encoding in the
> GUI and the console frames.
>=20
> 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 unconditi=
onally
use Unicode APIs when NTGUI_UNICODE is set. Maybe, someday, we can define=

NTGUI_UNICODE for the NT port too.


--------------enigD15F2F83A98301923307582F
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Cygwin)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCJrJIACgkQ17c2LVA10VttFwCeK7B47Re3O96p20fbH0wYqErL
Qz8AoI3p4GdwLa4ILT9PNShrQmi5FTRe
=I4in
-----END PGP SIGNATURE-----

--------------enigD15F2F83A98301923307582F--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12693; Package emacs,w32. Full text available.

Message received at 12693 <at> debbugs.gnu.org:


Received: (at 12693) by debbugs.gnu.org; 23 Oct 2012 16:24:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 23 12:24:21 2012
Received: from localhost ([127.0.0.1]:58021 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TQhHB-0004GK-6y
	for submit <at> debbugs.gnu.org; Tue, 23 Oct 2012 12:24:21 -0400
Received: from mtaout21.012.net.il ([80.179.55.169]:51287)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eliz@HIDDEN>) id 1TQhH8-0004G6-JK
	for 12693 <at> debbugs.gnu.org; Tue, 23 Oct 2012 12:24:19 -0400
Received: from conversion-daemon.a-mtaout21.012.net.il by
	a-mtaout21.012.net.il (HyperSendmail v2007.08) id
	<0MCC00500TDTDH00@HIDDEN> for
	12693 <at> debbugs.gnu.org; Tue, 23 Oct 2012 18:22:19 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0MCC005B0TH72YB0@HIDDEN>;
	Tue, 23 Oct 2012 18:22:19 +0200 (IST)
Date: Tue, 23 Oct 2012 18:22:17 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page
In-reply-to: <87a9vdgwyd.wl%%xmue@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Kazuhiro Ito <kzhr@HIDDEN>
Message-id: <83y5ixb1l2.fsf@HIDDEN>
References: <87y5j0ddgj.wl%%xmue@HIDDEN> <87k3uhjthd.fsf@HIDDEN>
	<87a9vdgwyd.wl%%xmue@HIDDEN>
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
	has
	identified this incoming email as possible spam. The original message
	has been attached to this so you can view it (if it isn't spam) or
	label similar future email.  If you have any questions, see
	the administrator of that system for details.
	Content preview:  > Date: Tue,
	23 Oct 2012 22:05:46 +0900 > From: Kazuhiro Ito
	<kzhr@HIDDEN> > Cc: 12693 <at> debbugs.gnu.org > > 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 [...] 
	Content analysis details:   (1.5 points, 10.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,
	no trust [80.179.55.169 listed in list.dnswl.org]
	0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail)
	0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
	[score: 0.5000]
X-Debbugs-Envelope-To: 12693
Cc: 12693 <at> debbugs.gnu.org, jasonr@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > Date: Tue, 23 Oct 2012 22:05:46 +0900 > From: Kazuhiro Ito
    <kzhr@HIDDEN> > Cc: 12693 <at> debbugs.gnu.org > > 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 [...] 
 
 Content analysis details:   (1.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
                             trust
                             [80.179.55.169 listed in list.dnswl.org]
  0.7 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
  0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
                             [score: 0.5000]

> Date: Tue, 23 Oct 2012 22:05:46 +0900
> From: Kazuhiro Ito <kzhr@HIDDEN>
> Cc: 12693 <at> debbugs.gnu.org
> 
> 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
  . encoding and decoding file names
  . encoding strings passed to various non-file APIs, like the one you
    mentioned

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.

> Please try the below code (cygwin, locale is ja_JP.UTF-8).
> 
> (list
>  locale-coding-system
>  (let ((locale-coding-system 'utf-8))
>    (format-time-string "%c"))
>  (let ((locale-coding-system 'cp932))
>    (format-time-string "%c")))

This is but one example.  As you yourself found out, this encoding is
unsuitable for the font interface.

> At present, locale-coding-system has to be ANSI code page for
> (w32-select-font)

So maybe we need w32-select-font to use UTF-16 in the cygw32 case, as
it does for menus.

> The cause is that we use two kinds of system calls, Windows's API
> and Cygwin's API (may three, if we count Windows's Unicode API).

See above: there's much more than just 3.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12693; Package emacs,w32. Full text available.

Message received at 12693 <at> debbugs.gnu.org:


Received: (at 12693) by debbugs.gnu.org; 23 Oct 2012 16:23:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 23 12:23:17 2012
Received: from localhost ([127.0.0.1]:58017 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TQhG8-0004Ej-UK
	for submit <at> debbugs.gnu.org; Tue, 23 Oct 2012 12:23:17 -0400
Received: from mtaout22.012.net.il ([80.179.55.172]:42532)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eliz@HIDDEN>) id 1TQhG5-0004ET-N1
	for 12693 <at> debbugs.gnu.org; Tue, 23 Oct 2012 12:23:15 -0400
Received: from conversion-daemon.a-mtaout22.012.net.il by
	a-mtaout22.012.net.il (HyperSendmail v2007.08) id
	<0MCC00B00SXW1W00@HIDDEN> for
	12693 <at> debbugs.gnu.org; Tue, 23 Oct 2012 18:12:44 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0MCC009AAT1772X0@HIDDEN>;
	Tue, 23 Oct 2012 18:12:43 +0200 (IST)
Date: Tue, 23 Oct 2012 18:12:42 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page
In-reply-to: <87k3uhjthd.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Jason Rumney <jasonr@HIDDEN>
Message-id: <83zk3db211.fsf@HIDDEN>
References: <87y5j0ddgj.wl%%xmue@HIDDEN> <87k3uhjthd.fsf@HIDDEN>
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
	has
	identified this incoming email as possible spam. The original message
	has been attached to this so you can view it (if it isn't spam) or
	label similar future email.  If you have any questions, see
	the administrator of that system for details.
	Content preview:  > From: Jason Rumney <jasonr@HIDDEN> > Date: Tue,
	23 Oct 2012 19:52:30 +0800 > Cc: 12693 <at> debbugs.gnu.org > >
	[locale-coding-system]
	is supposed to be set to the coding system that > system calls will
	accept, 
	which on Windows cannot be utf-8 (maybe on > recent versions it can be,
	but
	when I tried on Windows XP, it caused all > manner of problems). [...] 
	Content analysis details:   (1.5 points, 10.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,
	no trust [80.179.55.172 listed in list.dnswl.org]
	0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail)
	0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
	[score: 0.5000]
X-Debbugs-Envelope-To: 12693
Cc: kzhr@HIDDEN, 12693 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > From: Jason Rumney <jasonr@HIDDEN> > Date: Tue, 23 Oct
   2012 19:52:30 +0800 > Cc: 12693 <at> debbugs.gnu.org > > [locale-coding-system]
    is supposed to be set to the coding system that > system calls will accept,
    which on Windows cannot be utf-8 (maybe on > recent versions it can be, but
    when I tried on Windows XP, it caused all > manner of problems). [...] 
 
 Content analysis details:   (1.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
                             trust
                             [80.179.55.172 listed in list.dnswl.org]
  0.7 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
  0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
                             [score: 0.5000]

> From: Jason Rumney <jasonr@HIDDEN>
> Date: Tue, 23 Oct 2012 19:52:30 +0800
> Cc: 12693 <at> debbugs.gnu.org
> 
> [locale-coding-system] is supposed to be set to the coding system that
> system calls will accept, which on Windows cannot be utf-8 (maybe on
> recent versions it can be, but when I tried on Windows XP, it caused all
> manner of problems).

No, UTF-8 still cannot be used on Windows, AFAIK.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12693; Package emacs,w32. Full text available.

Message received at 12693 <at> debbugs.gnu.org:


Received: (at 12693) by debbugs.gnu.org; 23 Oct 2012 13:07:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 23 09:07:47 2012
Received: from localhost ([127.0.0.1]:57152 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TQeCw-00084F-8Q
	for submit <at> debbugs.gnu.org; Tue, 23 Oct 2012 09:07:46 -0400
Received: from msa105.auone-net.jp ([61.117.18.165]:52199)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <kzhr@HIDDEN>) id 1TQeCs-000843-BY
	for 12693 <at> debbugs.gnu.org; Tue, 23 Oct 2012 09:07:44 -0400
Received: from GUNGNIR.med.osaka-cu.ac.jp (unknown [114.179.36.76])
	by msa105.auone-net.jp (au one net msa) with ESMTP id 511B82C803A;
	Tue, 23 Oct 2012 22:05:46 +0900 (JST)
Date: Tue, 23 Oct 2012 22:05:46 +0900
Message-ID: <87a9vdgwyd.wl%%xmue@HIDDEN>
From: Kazuhiro Ito <kzhr@HIDDEN>
To: Jason Rumney <jasonr@HIDDEN>
Subject: Re: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page
In-Reply-To: <87k3uhjthd.fsf@HIDDEN>
References: <87y5j0ddgj.wl%%xmue@HIDDEN>	<87k3uhjthd.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
	FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0
	Emacs/24.2.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=SHIFT_JIS
Content-Transfer-Encoding: base64
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 12693
Cc: 12693 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.8 (/)

PiA+IFdoZW4gSSBydW4gRW1hY3Mgb24gQ3lnd2luIHdpdGggdGhlIG5hdGl2ZSBXaW5kb3dzIFVJ
LCBJIGNhbid0IHNwZWNpZnkNCj4gPiBmb250IGJ5IG5vbi1hc2NpaSBmb250IG5hbWUuICBGb3Ig
ZXhhbXBsZSwgdGhlIGJlbG93IGNvZGUgc3VjY2VzcyBvbg0KPiA+IHByZWNvbXBpbGVkIGJpbmFy
eSBvbiBXaW5kb3dzIChKYXBhbmVzZSBlZGl0aW9uKSBidXQgcmFpc2VzIGVycm9yIG9uDQo+ID4g
Q3lnd2luIHdpdGggdGhlIG5hdGl2ZSBXaW5kb3dzIFVJLg0KPiA+DQo+ID4gKHNldC1kZWZhdWx0
LWZvbnQgIoJsgnIgg1ODVoNig04tMTQiKQ0KPiA+DQo+ID4gVGhlIHJlYXNvbiBpcyB0aGF0IGxm
RmFjZU5hbWUgbWVtYmVyIG9mIExPR0ZPTlQgc3RydWN0dXJlIGlzIGV4cGVjdGVkDQo+ID4gdG8g
YmUgZW5jb2RlZCBpbiBBTlNJIGNvZGUgcGFnZSwgYnV0IEVtYWNzIGVuY29kZXMgaW4gb3IgZGVj
b2RlcyBhcw0KPiA+IHRoZSBjb2Rpbmcgc3lzdGVtIHNwZWNpZmllZCBpbiBsb2NhbGUtY29kaW5n
LXN5c3RlbSB2YXJpYWJsZS4gIEl0IGlzDQo+ID4gc2V0IHRvIHV0Zi04LXVuaXggb24gQ3lnd2lu
IGFuZCBjYXVzZXMgdGhlIGFib3ZlIHByb2JsZW0uDQo+IA0KPiBUaGlzIGlzIGEgcHJvYmxlbSB3
aXRoIHRoZSBDeWd3aW4gYnVpbGQncyBpbml0aWFsaXNhdGlvbiBvZg0KPiBsb2NhbGUtY29kaW5n
LXN5c3RlbS4gSXQgaXMgc3VwcG9zZWQgdG8gYmUgc2V0IHRvIHRoZSBjb2Rpbmcgc3lzdGVtIHRo
YXQNCj4gc3lzdGVtIGNhbGxzIHdpbGwgYWNjZXB0LCB3aGljaCBvbiBXaW5kb3dzIGNhbm5vdCBi
ZSB1dGYtOCAobWF5YmUgb24NCj4gcmVjZW50IHZlcnNpb25zIGl0IGNhbiBiZSwgYnV0IHdoZW4g
SSB0cmllZCBvbiBXaW5kb3dzIFhQLCBpdCBjYXVzZWQgYWxsDQo+IG1hbm5lciBvZiBwcm9ibGVt
cykuDQoNCk9uIEN5Z3dpbiwgbG9jYWxlLWNvZGluZy1zeXN0ZW0ncyB2YWx1ZSBkZXBlbmRzIG9u
IGl0cyBlbnZpcm9ubWVudC4NCkZvciBleGFtcGxlLA0KDQokIGVudiBMQU5HPWphX0pQLkNQOTMy
IGVtYWNzIC0tYmF0Y2ggLS1ldmFsICcocHJpbmMgbG9jYWxlLWNvZGluZy1zeXN0ZW0pJw0KLT4g
amFwYW5lc2UtY3A5MzItdW5peA0KDQokIGVudiBMQU5HPWphX0pQLlVURi04IGVtYWNzIC0tYmF0
Y2ggLS1ldmFsICcocHJpbmMgbG9jYWxlLWNvZGluZy1zeXN0ZW0pJw0KLT4gdXRmLTgtdW5peA0K
DQoNCkFuZCwgc29tZSBmdW5jdGlvbnMgZXhwZWN0IGxvY2FsZS1jb2Rpbmctc3lzdGVtIHRvIGJl
IHNldCBsb2NhbGUncw0KY29kaW5nIHN5c3RlbSwgbm90IEFOU0kgY29kZSBwYWdlLg0KUGxlYXNl
IHRyeSB0aGUgYmVsb3cgY29kZSAoY3lnd2luLCBsb2NhbGUgaXMgamFfSlAuVVRGLTgpLg0KDQoo
bGlzdA0KIGxvY2FsZS1jb2Rpbmctc3lzdGVtDQogKGxldCAoKGxvY2FsZS1jb2Rpbmctc3lzdGVt
ICd1dGYtOCkpDQogICAoZm9ybWF0LXRpbWUtc3RyaW5nICIlYyIpKQ0KIChsZXQgKChsb2NhbGUt
Y29kaW5nLXN5c3RlbSAnY3A5MzIpKQ0KICAgKGZvcm1hdC10aW1lLXN0cmluZyAiJWMiKSkpDQoN
Ci0+ICh1dGYtOC11bml4ICIyMDEylE4xMIyOMjOT+iAyMY6eMzCVqjM5lWIiICMoIjIwMTLlubQx
MOacXDIxMDIz5pelIDIx5plcMjAyMzDliFwyMDYzOeenXDIyMiIgNCA1IChjaGFyc2V0IGNwOTMy
LTItYnl0ZSkgNSA4IChjaGFyc2V0IGthdGFrYW5hLXNqaXMpIDggMTMgKGNoYXJzZXQgY3A5MzIt
Mi1ieXRlKSAxMyAxNyAoY2hhcnNldCBrYXRha2FuYS1zamlzKSAxNyAyNiAoY2hhcnNldCBjcDkz
Mi0yLWJ5dGUpKSkNCg0KDQpBdCBwcmVzZW50LCBsb2NhbGUtY29kaW5nLXN5c3RlbSBoYXMgdG8g
YmUgQU5TSSBjb2RlIHBhZ2UgZm9yDQoodzMyLXNlbGVjdC1mb250KSwgYW5kIGhhcyB0byBiZSBs
b2NhbGUncyBjb2Rpbmcgc3lzdGVtIGZvcg0KKGZvcm1hdC10aW1lLXN0cmluZyAiJWMiKS4gIFRo
ZSBjYXVzZSBpcyB0aGF0IHdlIHVzZSB0d28ga2luZHMgb2YNCnN5c3RlbSBjYWxscywgV2luZG93
cydzIEFQSSBhbmQgQ3lnd2luJ3MgQVBJIChtYXkgdGhyZWUsIGlmIHdlIGNvdW50DQpXaW5kb3dz
J3MgVW5pY29kZSBBUEkpLg0KDQotLSANCkthenVoaXJvIEl0bw0K




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12693; Package emacs,w32. Full text available.

Message received at 12693 <at> debbugs.gnu.org:


Received: (at 12693) by debbugs.gnu.org; 23 Oct 2012 11:54:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 23 07:54:40 2012
Received: from localhost ([127.0.0.1]:57109 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TQd4B-0006P6-Kf
	for submit <at> debbugs.gnu.org; Tue, 23 Oct 2012 07:54:40 -0400
Received: from mail-pa0-f44.google.com ([209.85.220.44]:49179)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <jasonrumney@HIDDEN>) id 1TQd49-0006Ot-Ha
	for 12693 <at> debbugs.gnu.org; Tue, 23 Oct 2012 07:54:38 -0400
Received: by mail-pa0-f44.google.com with SMTP id fb11so2522142pad.3
	for <12693 <at> debbugs.gnu.org>; Tue, 23 Oct 2012 04:52:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type:content-transfer-encoding;
	bh=HFiMoMdpWhycmNt3F1U+wd6mzEZO0GObCXTuFCGMxic=;
	b=kBRyaQKK/2tPQY6uZZN5EzOjcPWH5TBQsrYyxrAxx0GGs3Ws1RQNnkY5dbsrgxqaoV
	LUmt0NLpV4Da/C3yIiXgxzHzxdlaOZahyUdPcwKRq10geQadQ2NFIjVSsEvevkvX0cnj
	w35x1h5FZH/hgnQ00tUc+CKuLNhuGViUx114Bf6N3S3oaa7q/TXwEb860Mfgt43SyID6
	tqkg0AckJyGUzqOZ3+y4AcCE039eZisl4z8mZRXjPuDR3Ccu1pV5YxoO0DtqqVxNuSt4
	zO7VIKi+Bdot639pJHMS9MoPsNh01JuVfBVlvY23qVScBODB8cNDIp+ABRHqRfaXDv1k
	jWUQ==
Received: by 10.68.209.136 with SMTP id mm8mr38992952pbc.146.1350993157569;
	Tue, 23 Oct 2012 04:52:37 -0700 (PDT)
Received: from home.jasonrumney.net ([180.75.59.151])
	by mx.google.com with ESMTPS id rw5sm7590607pbc.54.2012.10.23.04.52.35
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 23 Oct 2012 04:52:36 -0700 (PDT)
Received: by home.jasonrumney.net (Postfix, from userid 1000)
	id 983401505; Tue, 23 Oct 2012 19:52:30 +0800 (MYT)
From: Jason Rumney <jasonr@HIDDEN>
To: Kazuhiro Ito <kzhr@HIDDEN>
Subject: Re: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page
References: <87y5j0ddgj.wl%%xmue@HIDDEN>
Date: Tue, 23 Oct 2012 19:52:30 +0800
In-Reply-To: <87y5j0ddgj.wl%%xmue@HIDDEN> (Kazuhiro Ito's message of
	"Sun, 21 Oct 2012 06:46:04 +0900")
Message-ID: <87k3uhjthd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 12693
Cc: 12693 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.1 (/)

Kazuhiro Ito <kzhr@HIDDEN> writes:

> When I run Emacs on Cygwin with the native Windows UI, I can't specify
> font by non-ascii font name.  For example, the below code success on
> precompiled binary on Windows (Japanese edition) but raises error on
> Cygwin with the native Windows UI.
>
> (set-default-font "=EF=BC=AD=EF=BC=B3 =E3=82=B4=E3=82=B7=E3=83=83=E3=82=
=AF-14")
>
> The reason is that lfFaceName member of LOGFONT structure is expected
> to be encoded in ANSI code page, but Emacs encodes in or decodes as
> the coding system specified in locale-coding-system variable.  It is
> set to utf-8-unix on Cygwin and causes the above problem.

This is a problem with the Cygwin build's initialisation of
locale-coding-system. It is supposed to be set to the coding system that
system calls will accept, which on Windows cannot be utf-8 (maybe on
recent versions it can be, but when I tried on Windows XP, it caused all
manner of problems).






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12693; Package emacs,w32. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Oct 2012 21:48:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 20 17:48:09 2012
Received: from localhost ([127.0.0.1]:53525 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TPgtt-00057s-3j
	for submit <at> debbugs.gnu.org; Sat, 20 Oct 2012 17:48:09 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51038)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <kzhr@HIDDEN>) id 1TPgtp-00057O-QI
	for submit <at> debbugs.gnu.org; Sat, 20 Oct 2012 17:48:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kzhr@HIDDEN>) id 1TPgsA-0002jJ-Ag
	for submit <at> debbugs.gnu.org; Sat, 20 Oct 2012 17:46:23 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:57331)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzhr@HIDDEN>) id 1TPgsA-0002jF-7L
	for submit <at> debbugs.gnu.org; Sat, 20 Oct 2012 17:46:22 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55289)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzhr@HIDDEN>) id 1TPgs9-00048K-5Z
	for bug-gnu-emacs@HIDDEN; Sat, 20 Oct 2012 17:46:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kzhr@HIDDEN>) id 1TPgs8-0002iv-0S
	for bug-gnu-emacs@HIDDEN; Sat, 20 Oct 2012 17:46:21 -0400
Received: from msa105.auone-net.jp ([61.117.18.165]:39734)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kzhr@HIDDEN>) id 1TPgs7-0002iY-GQ
	for bug-gnu-emacs@HIDDEN; Sat, 20 Oct 2012 17:46:19 -0400
Received: from GUNGNIR.med.osaka-cu.ac.jp (112-68-160-32f1.nar1.eonet.ne.jp
	[112.68.160.32])
	by msa105.auone-net.jp (au one net msa) with ESMTP id 573962C803A;
	Sun, 21 Oct 2012 06:46:12 +0900 (JST)
Date: Sun, 21 Oct 2012 06:46:04 +0900
Message-ID: <87y5j0ddgj.wl%%xmue@HIDDEN>
From: Kazuhiro Ito <kzhr@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.2.50; src/w32font.c should depend on ANSI code page
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
	FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0
	Emacs/24.2.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=ISO-2022-JP
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -3.5 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.5 (---)

When I run Emacs on Cygwin with the native Windows UI, I can't specify
font by non-ascii font name.  For example, the below code success on
precompiled binary on Windows (Japanese edition) but raises error on
Cygwin with the native Windows UI.

(set-default-font "MS ゴシック-14")

The reason is that lfFaceName member of LOGFONT structure is expected
to be encoded in ANSI code page, but Emacs encodes in or decodes as
the coding system specified in locale-coding-system variable.  It is
set to utf-8-unix on Cygwin and causes the above problem.

I think the below patch or similar modification would be needed.


=== modified file 'src/w32font.c'
--- src/w32font.c	2012-09-17 12:07:36 +0000
+++ src/w32font.c	2012-10-20 12:12:49 +0000
@@ -34,6 +34,15 @@
 #include "font.h"
 #include "w32font.h"
 
+/* From w32select.c */
+extern Lisp_Object QANSICP;
+
+#define ENCODE_ACP(str)					\
+  (code_convert_string_norecord (str, QANSICP, 1))
+
+#define DECODE_ACP(str)					\
+  (code_convert_string_norecord (str, QANSICP, 0))
+
 /* Cleartype available on Windows XP, cleartype_natural from XP SP1.
    The latter does not try to fit cleartype smoothed fonts into the
    same bounding box as the non-antialiased version of the font.
@@ -285,7 +294,7 @@
 Lisp_Object
 intern_font_name (char * string)
 {
-  Lisp_Object str = DECODE_SYSTEM (build_string (string));
+  Lisp_Object str = DECODE_ACP (build_string (string));
   int len = SCHARS (str);
   Lisp_Object obarray = check_obarray (Vobarray);
   Lisp_Object tem = oblookup (obarray, SDATA (str), len, len);
@@ -971,10 +980,10 @@
       }
     if (name)
       font->props[FONT_FULLNAME_INDEX]
-        = DECODE_SYSTEM (build_string (name));
+        = DECODE_ACP (build_string (name));
     else
       font->props[FONT_FULLNAME_INDEX]
-	= DECODE_SYSTEM (build_string (logfont.lfFaceName));
+	= DECODE_ACP (build_string (logfont.lfFaceName));
   }
 
   font->max_width = w32_font->metrics.tmMaxCharWidth;
@@ -2035,7 +2044,7 @@
       else if (SYMBOLP (tmp))
 	{
 	  strncpy (logfont->lfFaceName,
-		   SDATA (ENCODE_SYSTEM (SYMBOL_NAME (tmp))), LF_FACESIZE);
+		   SDATA (ENCODE_ACP (SYMBOL_NAME (tmp))), LF_FACESIZE);
 	  logfont->lfFaceName[LF_FACESIZE-1] = '\0';
 	}
     }
@@ -2131,7 +2140,7 @@
       if (NILP (family))
         continue;
       else if (SYMBOLP (family))
-        name = SDATA (ENCODE_SYSTEM (SYMBOL_NAME (family)));
+        name = SDATA (ENCODE_ACP (SYMBOL_NAME (family)));
       else
 	continue;
 
@@ -2511,7 +2520,7 @@
       || logfont_to_fcname (&lf, cf.iPointSize, buf, 100) < 0)
     return Qnil;
 
-  return DECODE_SYSTEM (build_string (buf));
+  return DECODE_ACP (build_string (buf));
 }
 
 static const char *const w32font_booleans [] = {

=== modified file 'src/w32select.c'
--- src/w32select.c	2012-10-11 00:32:25 +0000
+++ src/w32select.c	2012-10-20 06:11:00 +0000
@@ -117,7 +117,8 @@
    based on current system parameters. */
 static LCID DEFAULT_LCID;
 static UINT ANSICP, OEMCP;
-static Lisp_Object QUNICODE, QANSICP, QOEMCP;
+static Lisp_Object QUNICODE, QOEMCP;
+Lisp_Object QANSICP;
 
 /* A hidden window just for the clipboard management. */
 static HWND clipboard_owner;


-- 
Kazuhiro Ito




Acknowledgement sent to Kazuhiro Ito <kzhr@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#12693; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 26 May 2017 23:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.