Subject: Re: bug#3237: Bug report, going back to 22.1

From: Jason Rumney <[email-masked]>
Date: Sun, 21 Jun 2009 11:43:42 +0800

Jason Rumney wrote:
> Please explain what keys you press, what characters you expect to see, 
> and what characters you do see.  I have tried setting my keyboard to 
> Polish (214) and pressing the keys indicated in the keymap at
>    http://ascii-table.com/img/keyboard-214.png
> All of the keys that are present on my keyboard seem to work, but some 
> of the characters you report above are missing from that keymap.
> Windows has another Polish keymap, but I can't find any documentation 
> of which keys I need to press to get non-ASCII characters.

OK, I found the bug. The characters in question are in the range 128-159 
in windows-1250. Since your system codepage is windows-1252, they are 
being interpreted by Emacs first as windows-1252 characters. These map 
to unicode codepoints above 255, so the keyboard-coding-system has no 
effect on them (they are outside the range expected by windows-1250).

Actually, this reveals that since the addition of multibyte keyboard 
handling in w32term.c, it will only work if the system codepage matches 
the keyboard locale, or if the system codepage is windows-1252 and the 
input characters are in the range 160-255 where their values will not be 
changed, and keyboard-coding-system can be used to postprocess them.  
Since this is a regression compared to the raw keyboard input of Emacs 
22.1 and earlier which could always be post-processed by 
keyboard-coding-system, I have checked in the fix before the branch is 
created.