I am working with UCS2 encoded strings: eg 3114 3116 3127 3119 (Chinese
in this case).

Is there a way of converting or encoding these pairs, to show their
Unicode characters in a Richedit control?   The obvious,

my $string = pack ("U*", 0x3114, 0x3116, 0x3127, 0x3119);

$re->Text($string);

Does print something, but not the correct representations. 

When entering these pairs into Wordpad you have to specify the font
first. I can also load a Win32::GUI window with a Richedit control,
change the language setting to Chinese (L-ALT, Shift) and enter the
pairs into the Richedit control directly, which display correctly.

If you save the text as .RTF and view in notepad, it prefixes the chars
with lang1028 although the documentation on MSDN doesn't suggest how you
convert these chars or determine that it is 'lang1028' as opposed to
'lang1041' (Japanese).

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dnrtfspec/html/rtfspec_6.asp

Does anyone know if it is possible to interpret the hex pairs and
determine the language/codepage/conversion to allow the correct
character to be displayed in the Richedit control?

Is it possible to convert the UCS2 encoded strings to display in the
Richedit control if they are not based on the default Latin1 codepage?

Cheers

Chris





Reply via email to