From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joakim =?UTF-8?Q?H=C3=A5rsman?= Newsgroups: gmane.emacs.bugs Subject: bug#10299: Emacs doesn't handle Unicode characters in keyboard layout on MS Windows Date: Mon, 19 Dec 2011 11:44:55 +0100 Message-ID: References: <8739clgapc.fsf@gnu.org> <83zket20xw.fsf@gnu.org> <83vcph0w9t.fsf@gnu.org> <83obv821wv.fsf@gnu.org> <831us31atj.fsf@gnu.org> <83pqflzr1d.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1324291528 14309 80.91.229.12 (19 Dec 2011 10:45:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Dec 2011 10:45:28 +0000 (UTC) Cc: 10299@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 19 11:45:24 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rcaih-0005Un-Gc for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Dec 2011 11:45:23 +0100 Original-Received: from localhost ([::1]:44061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcaig-0002ob-9u for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Dec 2011 05:45:22 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:32889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcaib-0002oW-61 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 05:45:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RcaiV-0005HL-B0 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 05:45:17 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcaiV-0005H9-7W for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 05:45:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RcakI-00008F-FW for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 05:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Joakim =?UTF-8?Q?H=C3=A5rsman?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Dec 2011 10:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10299 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10299-submit@debbugs.gnu.org id=B10299.1324291610490 (code B ref 10299); Mon, 19 Dec 2011 10:47:02 +0000 Original-Received: (at 10299) by debbugs.gnu.org; 19 Dec 2011 10:46:50 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rcak6-00007q-4f for submit@debbugs.gnu.org; Mon, 19 Dec 2011 05:46:50 -0500 Original-Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rcak4-00007i-BZ for 10299@debbugs.gnu.org; Mon, 19 Dec 2011 05:46:49 -0500 Original-Received: by eaad1 with SMTP id d1so4466084eaa.3 for <10299@debbugs.gnu.org>; Mon, 19 Dec 2011 02:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=m2bsXyW4o3e94nFQ9uSxlgoQ4Ey/3VQe/0r8rG+9U+0=; b=qHnZdvoDJ3El/KNK/4NclSHHn0PmJmJMLCFaI7hCra2LJCgDPmOuKNcKaPfvWBBtf0 7EVjylr0rhOcNYM7y8ZgsiHaeCUfSzQT0+laCR5/tH01+oxVsAzh2xUvy682cnZ9kClE TOA/Isz5k1SzFIpssmHKoWXgIqYVAogGBpoWQ= Original-Received: by 10.205.128.12 with SMTP id hc12mr1156516bkc.133.1324291495428; Mon, 19 Dec 2011 02:44:55 -0800 (PST) Original-Received: by 10.204.58.209 with HTTP; Mon, 19 Dec 2011 02:44:55 -0800 (PST) In-Reply-To: <83pqflzr1d.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 19 Dec 2011 05:47:02 -0500 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:55058 Archived-At: On 18 December 2011 19:13, Eli Zaretskii wrote: >> Date: Sun, 18 Dec 2011 18:31:55 +0100 >> From: Joakim H=E5rsman >> >> > That's good news. =A0However, I'm puzzled: are you saying that the cod= e >> > points passed by Windows to Emacs for the characters generated by MKLC >> > are outside the Unicode BMP, i.e. larger than 65535? =A0If so, what co= de >> > points are they? >> >> No, none of the characters I needed are outside the BMP. >> >> WM_CHAR encodes the codepoint in UTF-16 inside wParam, while >> WM_UNICHAR uses UTF-32. So if I press something which gives U+2218 >> RING OPERATOR, I get a WM_CHAR event with a wParam of 2228248 or >> 0x220018. > > ??? UTF-16 encodes the characters in the BMP as themselves, i.e. a > single 16-bit value that is numerically identical to the codepoint. > That is, you should have gotten 0x2218. =A0What am I missing? I just assumed Windows encoded the codepoints into a DWORD in some funky way, but looking more closely at the documentattion it appears like wParam should just be the codepoint. Even more strangely, some places claim that if a keyboard produces a character outside the BMP, you get two WM_CHAR events. >From what I can tell, Emacs itself never alters wParam, but I guess Windows might do some funky multibyte encoding since Emacs isn't completely Unicode? >> I experimented a bit, and CreateWindowW isn't needed after all. As >> long as I use RegisterClassW and GetMessageW, things work. I'm unsure >> if it's TranslateMessage that translates the key press to a question >> mark or if it's GetMessage that does it on receiving the message. > > Question marks are a sign that Windows tried to convert the character > to its ANSI equivalent, and failed. =A0I.e., it means that Windows > thought the program asked for ANSI encoded characters. =A0So it's > probably TranslateMessage that did it. > >> I'll try to get frame titles working again as well, then I can >> probably switch on os_subtype in two or three places and Windows 95 >> won't be affected at all. Do you think that is a good plan? > > Yes, thanks.