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#12082: 24.1.50; Wrong character showed by "C-h c" Date: Mon, 30 Jul 2012 17:32:23 +0300 Message-ID: <83obmxfhfs.fsf@gnu.org> References: <83d33eh10q.fsf@gnu.org> <834nophqbw.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1343658785 19467 80.91.229.3 (30 Jul 2012 14:33:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 30 Jul 2012 14:33:05 +0000 (UTC) Cc: 12082@debbugs.gnu.org To: Juanma Barranquero , Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 30 16:33:02 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 1Svr1k-0004Uz-HI for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Jul 2012 16:32:56 +0200 Original-Received: from localhost ([::1]:58412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Svr1j-0003IR-TW for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Jul 2012 10:32:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Svr1g-0003IH-TS for bug-gnu-emacs@gnu.org; Mon, 30 Jul 2012 10:32:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Svr1c-0003Pm-It for bug-gnu-emacs@gnu.org; Mon, 30 Jul 2012 10:32:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Svr1c-0003Pi-FA for bug-gnu-emacs@gnu.org; Mon, 30 Jul 2012 10:32:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Svr8b-0002Kb-Mc for bug-gnu-emacs@gnu.org; Mon, 30 Jul 2012 10:40:01 -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: Mon, 30 Jul 2012 14:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12082 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12082-submit@debbugs.gnu.org id=B12082.13436591688918 (code B ref 12082); Mon, 30 Jul 2012 14:40:01 +0000 Original-Received: (at 12082) by debbugs.gnu.org; 30 Jul 2012 14:39:28 +0000 Original-Received: from localhost ([127.0.0.1]:50974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Svr84-0002Jn-An for submit@debbugs.gnu.org; Mon, 30 Jul 2012 10:39:28 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:47628) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Svr81-0002Jd-IF for 12082@debbugs.gnu.org; Mon, 30 Jul 2012 10:39:26 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M7Z00J009E4K300@a-mtaout23.012.net.il> for 12082@debbugs.gnu.org; Mon, 30 Jul 2012 17:32:10 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M7Z00J1B9PLK120@a-mtaout23.012.net.il>; Mon, 30 Jul 2012 17:32:10 +0300 (IDT) In-reply-to: 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:62629 Archived-At: > From: Juanma Barranquero > Date: Mon, 30 Jul 2012 13:47:44 +0200 >=20 > On Mon, Jul 30, 2012 at 5:37 AM, Eli Zaretskii wrote= : >=20 > > Interesting. How did you two type M-=C3=A7? And what are your v= alues of > > keyboard and terminal coding-systems, and also what does > > w32-get-console-codepage return? >=20 > Ah, now I see a difference. Interesting, yes. >=20 > I did the last check from a TCC console, not CMD, the difference be= ing > that in TCC I set the codepage to 1252, while CMD uses 850. >=20 > So yes, starting emacs from CMD in window mode, C-h c M-=C3=A7 inde= ed > produces the =E2=80=A1 message. >=20 > I type M-=C3=A7 with the left Alt key and the =C3=A7 key of the Spa= nish keyboard. >=20 > So, to summarize: >=20 > - In CMD, with active codepage =3D 437 > - Window mode: > keyboard-coding-system =3D windows-1252-unix > (terminal-coding-system) =3D cp1252 > (w32-get-console-codepage) =3D 437 > Messages: "M-=E2=80=A1 is undefined" >=20 > - Non-window mode: > keyboard-coding-system =3D cp437-unix > (terminal-coding-system) =3D cp437 > (w32-get-console-codepage) =3D 437 > Messages: "M-=C3=A7 is undefined" >=20 > - In CMD, with active codepage =3D 850 >=20 > - Window mode: > keyboard-coding-system =3D windows-1252-unix > (terminal-coding-system) =3D cp1252 > (w32-get-console-codepage) =3D 850 > Message: "M-=E2=80=A1 is undefined" >=20 > - Non-window mode: > keyboard-coding-system =3D cp850-unix > (terminal-coding-system) =3D cp850 > (w32-get-console-codepage) =3D 850 > Message: "M-=C3=A7 is undefined" >=20 > - In CMD, with active codepage =3D 1252 >=20 > - Window mode: > keyboard-coding-system =3D windows-1252-unix > (terminal-coding-system) =3D cp1252 > (w32-get-console-codepage) =3D 1252 > Message: "M-=C3=A7 is undefined" >=20 > - Non-window mode: > keyboard-coding-system =3D windows-1252-unix > (terminal-coding-system) =3D cp1252 > (w32-get-console-codepage) =3D 1252 > Message: "M-=C3=A7 is undefined" Looks like Windows lies to us about the input codepage. Please apply the patches below, run Emacs in GUI mode under GDB, and do the following experiments: . switch the keyboard to English ("EN" near the system tray), if yo= u can, and type a couple of pure ASCII characters . switch the keyboard to Spanish and type =C3=A7 and M-=C3=A7 . do the latter both with active codepage 850 and 1252 In each case, show the DebPrint messages shown by GDB as result of typing each character. Thanks. =3D=3D=3D modified file 'src/w32fns.c' --- src/w32fns.c=092012-07-29 08:18:29 +0000 +++ src/w32fns.c=092012-07-30 14:06:20 +0000 @@ -2918,6 +2918,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARA =20 case WM_SYSCHAR: case WM_CHAR: + DebPrint (("w32fns: WM_CHAR 0x%x\n", wParam)); post_character_message (hwnd, msg, wParam, lParam, =09=09=09 w32_get_key_modifiers (wParam, lParam)); break; @@ -2939,6 +2940,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARA =20 { W32Msg wmsg; +=09DebPrint (("w32fns: WM_UNICHAR 0x%x\n", wParam)); wmsg.dwModifiers =3D w32_get_key_modifiers (wParam, lParam); signal_user_input (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); =3D=3D=3D modified file 'src/w32term.c' --- src/w32term.c=092012-07-29 08:18:29 +0000 +++ src/w32term.c=092012-07-30 14:07:21 +0000 @@ -4295,6 +4295,7 @@ w32_read_socket (struct terminal *termin =20 if (msg.msg.message =3D=3D WM_UNICHAR) { +=09=09 DebPrint (("w32term: WM_UNICHAR 0x%x\n", msg.msg.wParam)); inev.code =3D msg.msg.wParam; } else if (msg.msg.wParam < 256) @@ -4336,6 +4337,9 @@ w32_read_socket (struct terminal *termin break; } } + +=09=09 DebPrint (("w32term: 0x%x =3D> 0x%x (cp%d)\n", +=09=09=09 (char) msg.msg.wParam, code, keyboard_codepage)); inev.code =3D code; } else