ANSI / UNICODE conversion of Greek and Turkish in WinCE ??

ANSI / UNICODE conversion of Greek and Turkish in WinCE ??

Post by Yu » Sat, 10 Jun 2006 15:44:18


Hi,

I put all Greek/Turkish string in a text file with ANSI format.
I know WinCE uses UNICODE.
Now I have a OS with Greek/Turkish codepage.
However, Greek/Turkish character can not be correctly shown in the dialog on
WinCE 5.0.
How can I solve this issue ?


Thanks.

Yu.
 
 
 

ANSI / UNICODE conversion of Greek and Turkish in WinCE ??

Post by Ulrich Eck » Sat, 10 Jun 2006 16:32:32


I don't think so. 'ANSI' is not really a format, at most it is used
synonymous with ASCII or some extension thereof. So, the first thing to
find out is the _real_ format of the file.


MS Windows CE and newer desktop variants use UTF-16 internally to handle
strings (paths etc) but programs can of course still use char-based strings
(with whatever meaning they assign to a char).


A codepage is a mapping between characters (or letters) and values of bytes.
Using the right conversion table, you can map the byte-values in the
codepage to their according Unicode codepoints. Using those, you can
convert them to UTF-16 (you're lucky, only Thai IIRC requires something
different than a one-to-one mapping). Using google it is usually feasible
to find out what mapping which codepage has.


Okay, this might have another totally trivial reason: if the used font does
not include the characters, it obviously can't display them - you get the
well-known boxes then. For a starter, you can define a string like this:

wchar_t somestring[] = {
L'a',// letter 'a'
0x20ac, // euro sign
0xabcd, // TODO: insert some Greek/Turkish codepoint here
L'\0' // trailing zero to terminate string
};

...and try to display it in a dialog. If you get boxes, you need to use a
different font. You can download PDFs with codepoint tables from
www.unicode.org to find out what exactly to fill in for the codepoint.

Uli