From: Philippe Verdy (verdy_p@wanadoo.fr)
Date: Wed Jan 14 2004 - 15:18:51 EST
Code points on WindowsFrom: Mike Ayers
> On Windows, it is well known that you can generate a character from its
code point
> by holding down the alt key and typing the code point in decimal, with a
leading 0,
> on the numeric keypad.
Correction: what you generate is not the (Unicode) code point but only the
code position in your current Windows ANSI code page (even if the characters
generated will be coded with Unicode). The reason for that is that Windows
must be able to return WM_CHAR events to applications that are not prepared
to recveive something else than ANSI characters, if these applications use
the legacy ANSI API.
But if the application uses the Unicode version of the
GetMessage()/TranslateMessage() API, it will receive WM_CHAR events
containing the Unicode codepoints (in fact only UTF-16 code units)
corresponding to keyboard input events.
You can't use that input method to enter any Unicode code point (the user
has no way to determine whever the application uses the Unicode API or the
ANSI API internally, so the input sequence should be consistent across
multiple applications for the same input sequence defined for only ANSI
characters), and there are lots of difference between the ANSI code page and
Unicode code points in the range 128 to 159 as well as on all other higher
codes if your Windows code page is not 1252 (Western European, based on
Latin1).
There's nothing in the default keyboard drivers to allow you input directly
from the keyboard, characters that are not in your current Windows code page
(the default keyboard drivers will not return characters outside of this
codepage).
When this support is added, it does not come from the keyboard driver
itself, but from GUI input components like rich-edit controls, which will
remap the keyboard events using alternate conversion rules to generate
characters outside of the current Windows ANSI codepage (for example by
mapping AltGr+x followed by hexadecimal Unicode code point).
This archive was generated by hypermail 2.1.5 : Wed Jan 14 2004 - 16:02:14 EST