• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with unicode..(it seems i am missing a bit only now)

 
Lee Mark
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String str = "\u0aa6\u0aa6\u0aa6\u0aa6\u0aa6"; /a gujarati text
if i add to combobox then it works well ,gujarati character gets displayed.
but if i once convert it to bytes then if i again convert it back to String then it is giving me garbage string

code:
{code}String str = "\u0aa6\u0aa6\u0aa6\u0aa6\u0aa6"; /a gujarati text
choiceGroup.append(str,null); // j2me's combobox WORKS
byte[] a= str.getBytes();
choiceGroup.append(new String(a),null); // j2me's combobox NOT WORKING
choiceGroup.append(new String(a,"UTF-8"),null); // j2me's combobox NOT WORKING{code}

here not working in the sense it is giving garbage characters.

and i need to convert it to bytes any how because i want to write it to rms.

Thanks .



 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!