A mistake in keysymdef.h with upsilon symbol?

Alan Coopersmith alan.coopersmith at oracle.com
Tue Sep 1 18:24:22 PDT 2015


On 09/ 1/15 06:16 PM, Mats Blakstad wrote:
> Hi
>
> I work to make a patch to add new keysym names to this file:
> http://cgit.freedesktop.org/xorg/proto/x11proto/tree/keysymdef.h
>
> I noticed that unicode 01b1 is listed like this:
>
> #define XK_aogonek                       0x01b1  /* U+0105 LATIN SMALL LETTER A
> WITH OGONEK */
>
> However, unicode 01b1 is in fact the capital version of latin upsilon
> <https://en.wikipedia.org/wiki/%C6%B1>, so it should be Ʊ.
>
> Or is the number on the side '0x01b1' not a unicode?

It is not.   It is the X keysym value defined before Unicode existed.
The U+... in the comment is the Unicode value.

> And if so, how can I find out what code to use for different unicodes?

See the long comment near the top of the file, after the license info,
which includes:

  * For any future extension of the keysyms with characters already
  * found in ISO 10646 / Unicode, the following algorithm shall be
  * used. The new keysym code position will simply be the character's
  * Unicode number plus 0x01000000. The keysym values in the range
  * 0x01000100 to 0x0110ffff are reserved to represent Unicode
  * characters in the range U+0100 to U+10FFFF.

and

  * Before adding new keysyms, please do consider the following: In
  * addition to the keysym names defined in this file, the
  * XStringToKeysym() and XKeysymToString() functions will also handle
  * any keysym string of the form "U0020" to "U007E" and "U00A0" to
  * "U10FFFF" for all possible Unicode characters. In other words,
  * every possible Unicode character has already a keysym string
  * defined algorithmically, even if it is not listed here. Therefore,
  * defining an additional keysym macro is only necessary where a
  * non-hexadecimal mnemonic name is needed, or where the new keysym
  * does not represent any existing Unicode character.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list