using .nls files in a smart device mfc, vc++ application  
Author Message
kulkarni





PostPosted: Smart Devices Native C++ Development, using .nls files in a smart device mfc, vc++ application Top

hello everyone,

can anyone tell me how the .nls files can be used

i have a smart device mfc, vc++ apllication and i need to give multilingual feature to my application. i have read about .nls files, locale ID, country code, code page,etc...

but i'm not quite sure how i can use them.

could anyone pls make it clear/illustrate with some sample application/code for me.

its kind of urgent.

any useful links would be of great help.

 

thanks in advance

Kulkarni

 



Smart Device Development15  
 
 
EricShan





PostPosted: Smart Devices Native C++ Development, using .nls files in a smart device mfc, vc++ application Top

what I know wince.nls(the only .nls on smartphone) is a table, I use to convert between MBCS and Unicode(MultiByteToWideChar,WideCharToMultiByte)

In the old time before unicode appears, East asian characters using two BYTEs to represent themselves, that is
MBCS plus codepage. The same two BYTES could reprensent different character in Chinese GB or Chinese BIG5
depend on code page they indicated. So if you display MBCS characters which originally generated using
codepage of Chinese GB with Chieses BIG5, then no body could recognize it even Chinese.

When Unicode comes, all conntry shares one table, and Chinese GB will never mixed with Japanese, korea...etc.
Once two bytes defined, the character it represent can be identically located in unicode table. So there is
no code page need any more.

So if you want to translate English to Chinese, there is no way to use Wince.nls to do it. If you want to
convert Chinese GB MBCS to Chinese BIG5 MBCS, you can convert Chinese GB to unicode first then search the
table again from Unicode find the Chinese BIG5.

So if you need a multilanguage resource, give it to the people speak that language, ask them type in Notepad,
save that notepad with Unicode and send back to you, you get rid of the first FF FE in the text file in binary.
And import it into your resource with the language specified.

Some reference:

http://www.microsoft.com/typography/unicode/cscp.htm
http://www.i18nguy.com/unicode/c-unicode.html
http://support.microsoft.com/ scid=http%3a%2f%2fwww.support.microsoft.com%2fkb%2f151701%2fen-us%2f