Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need some help with unicode on J2ME

 
Roger Chaosway
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

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.

For eg:
Hashtable devanagariMap = new Hashtable(85);
devanagariMap.put("2309","a");
devanagariMap.put("2310","aa");
devanagariMap.put("2311","i");
devanagariMap.put("2312","ee");
devanagariMap.put("2313","u");
devanagariMap.put("2314","oo");
devanagariMap.put("2315","ri");
.... 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!
 
Gopinath Karyadath
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Please put this issue in Nokia Forum.

http://discussion.forum.nokia.com/forum/

Regards
gopi@c2info.com
 
Roger Chaosway
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!

Does this means no pointers at the Saloon?
 
Gopinath Karyadath
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I gave this link for quick response .
there are many others with the same query.

Regards
gopi@c2info.com
 
Roger Chaosway
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My bad! Patience be mine!
I'm waiting for other fellow greenhorns too. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic