Posts tagged ‘utf-8’

All you need to know about unicode

Recently I stumbled about this great article about ASCII, 7 and 8 Bit, codepages, Multi byte, Wide byte and unicode: http://www.joelonsoftware.com/articles/Unicode.html

If you ever get in trouble with wrong encoding display of chars, give this article a try to know the backgrounds.

As you know, Windows CE and Windows Mobile  is always unicode except for serial and socket communication. But the truetype fonts available on Windows Mobile devices mostly support only common chars, there file size is about 600K. The file size of Arial Unicode MS is about 22MB.

regards

keyToggleChar – a tool to enter UTF-8 national chars via keyboard

As you may know my keyToggle app to be able to use the number keys on a windows mobile device as function keys, here is another one that enables you to enter special national chars, like Å, Ä Æ etc. directly via the keyboard. You must specify 10 keys and there UTF-8 replacements. Configuration is done via the registry:

3.0        added code for read/write reg for CharTable and KeyTable
 REGEDIT4

 [HKEY_LOCAL_MACHINE\Software\Intermec\KeyToggleChar]
 "KeyTable"=hex:\
 30,31,32,33,34,35,36,37,38,39
 "CharTable"=hex:\
 C6,00,E6,00,D8,00,F8,00,C5,00,E5,00,C2,00,E2,00,C4,00,E4,00
 "LEDid"=dword:00000001
 "autoFallback"=dword:00000000
 "Timeout"=dword:00000003
 "StickyKey"=dword:00000074

 KeyTable     holds a list of 10 keys which will be 'remapped'
 CharTable    holds  list of UniChar codes to use as replacement
 LEDid        defines the ID of the LED to use for showing sticky state
 autoFallback defines, if the sticky state is reset after a mapped key is pressed.
              Use 0, if you dont want the sticky state to fallback after keypress
 TimeOut      defines a timout after which sticky state will be reset

To get the UTF-8 word entries for Unicode chars, see for example here: http://www.unicode.org/charts/charindex.html

The default mapping used here is defined as follows and maps the keys 0-9 to:

0x00c6, 0x00e6, 0x00d8, 0x00f8, 0x00C5, 0x00e5, 0x00c2, 0x00e2, 0x00c4, 0x00e4
 AE        ae     O/       o/      A°      a°      A^      a^      Ä       ä

The main problem I had was finding a function to get the window handle of the current input active window. Finally I found GetForegroundKeyboardTarget() (after some days of searching).

Continue reading ‘keyToggleChar – a tool to enter UTF-8 national chars via keyboard’ »