If you've ever run into problems faced with multi-lingual text differences, Jason's latest article will solve just that. Learn how to make use of Unicode character-sets when developing in a J2ME-based environment, where you'll more than likely have a need to develop MIDlets in multiple languages.
J2ME and Unicode - Reading a Text File with Unicode Codes (Page 5 of 6 )
In the last section we went over reading a Unicode file. An alternative approach is to read the text file with Unicode codes in them. Referring back to the Hello World example the following would be inside the text file:
One would think this is very straight forward and that a simple load/read of the text would do. However, when reading the file each character is treated as a string. So in other words:
reads in as
‘’, ‘u’, ‘3’,’0’,’5’,’3’
You will now have to detect and parse out the u which indicates that the next four characters represent a Unicode character. The following method will help convert the string to the appropriate Unicode character. It assumes you are only passing in a valid four character Unicode (ie: 3053).