I'm creating a J2ME application with multi-lingual text capabilities. I'm developing it with Sun WTK 2.2 for certain backward compatibility requirements.
My J2ME client communicates with a server over WLAN/GPRS which responds back with a text stream. That response string could be in any script. As of now, it is encoded in Devanagari (Hindi). We are transliterating the Devanagari string to Roman script on the client. While the transliteration works fine on the desktop emulator with WTK 2.2, on the client it displays 'nullnullnullnullnull'.
I'm doing a very simple transliteration. I load all the Unicode entity codes of Devanagari as keys and the corresponding letters in Roman as values in a Hashtable.
Hashtable devanagariMap = new Hashtable(85);
.... and so on ....
I'm using simple integer entity codes. I know I can use Hex codes too.
I then decode the response string by reading the individual characters. Then I get the integer values of those characters and get their Roman equivalent from the Hashtable.
It works fine on Desktop emulator. But on the mobile (I'm using Nokia N95) it fails and just displays 'nullnullnullnullnullnull...'. Can anyone give me some pointer on this?
I suspect maybe its a mismatch between the desktop emulator JVM and the N95 JVM. But not sure. Can someone please give me some pointers? I can provide more details if you require.
Thanks in advance!