From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12693: 24.2.50; src/w32font.c should depend on ANSI code page Date: Tue, 23 Oct 2012 18:22:17 +0200 Message-ID: <83y5ixb1l2.fsf@gnu.org> References: <87y5j0ddgj.wl%%xmue@d1.dion.ne.jp> <87k3uhjthd.fsf@gnu.org> <87a9vdgwyd.wl%%xmue@d1.dion.ne.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1351009400 24061 80.91.229.3 (23 Oct 2012 16:23:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Oct 2012 16:23:20 +0000 (UTC) Cc: 12693@debbugs.gnu.org To: Kazuhiro Ito Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 23 18:23:28 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TQhGI-0001wV-JG for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Oct 2012 18:23:26 +0200 Original-Received: from localhost ([::1]:60429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQhGB-0002IU-0P for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Oct 2012 12:23:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQhG2-0002HP-P5 for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 12:23:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQhG1-0002mP-LS for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 12:23:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQhG1-0002mF-I0 for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 12:23:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TQhHq-0004HN-81 for bug-gnu-emacs@gnu.org; Tue, 23 Oct 2012 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Oct 2012 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12693 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: patch Original-Received: via spool by 12693-submit@debbugs.gnu.org id=B12693.135100946116391 (code B ref 12693); Tue, 23 Oct 2012 16:25:02 +0000 Original-Received: (at 12693) by debbugs.gnu.org; 23 Oct 2012 16:24:21 +0000 Original-Received: from localhost ([127.0.0.1]:58021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TQhHB-0004GK-6y for submit@debbugs.gnu.org; Tue, 23 Oct 2012 12:24:21 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:51287) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TQhH8-0004G6-JK for 12693@debbugs.gnu.org; Tue, 23 Oct 2012 12:24:19 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MCC00500TDTDH00@a-mtaout21.012.net.il> for 12693@debbugs.gnu.org; Tue, 23 Oct 2012 18:22:19 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MCC005B0TH72YB0@a-mtaout21.012.net.il>; Tue, 23 Oct 2012 18:22:19 +0200 (IST) In-reply-to: <87a9vdgwyd.wl%%xmue@d1.dion.ne.jp> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65926 Archived-At: > Date: Tue, 23 Oct 2012 22:05:46 +0900 > From: Kazuhiro Ito > Cc: 12693@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.