Subject: Re: bug#10299: Emacs doesn't handle Unicode characters in keyboard layout on MS Windows

From: Eli Zaretskii <[email-masked]>
Date: Fri, 16 Dec 2011 13:22:01 +0200

> Date: Fri, 16 Dec 2011 12:01:02 +0100
> From: Joakim Hårsman <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
> So I'll try to change to using RegisterClassW which should fix this
> issue but might break other stuff since more messages will deliver
> Unicode text then.

I think using RegisterClassW is the right way.  But please pay
attention to this part of w32term.c:w32_read_socket:

              if (msg.msg.message == WM_UNICHAR)
                {
                  inev.code = msg.msg.wParam;
                }
              else if (msg.msg.wParam < 256)
                {
                  ...
                }
              else
                {
                  /* Windows shouldn't generate WM_CHAR events above 0xFF
                     in non-Unicode message handlers.  */
                  DebPrint (("Non-byte WM_CHAR: %d\n", msg.msg.wParam));
                  inev.kind = NO_EVENT;
                  break;
                }
              inev.kind = inev.code < 128 ? ASCII_KEYSTROKE_EVENT
                                          : MULTIBYTE_CHAR_KEYSTROKE_EVENT;

If Windows continues sending WM_CHAR to Emacs even if you call
RegisterClassW, you will probably need to modify the "else" clause to
use the characters with codepoints beyond 256, instead of throwing
them away.