5

i am a new Android developer, I have a UTF-16LE encoded string. I would like to print that string in Textview of my activity. However, the string in Hindi Language. and when i get Sysout for the string it shows write format and words(Eg: 05-07 12:31:53.050: I/System.out(22887): str = बसंत पंचमी, str = मकर संक्रान्ति / पोंगल). but in the TextView of device it shows only BOXES.
here is the code:-

 String myString = मकर संक्रान्ति / बसंत पंचमी;
 String correct = null;
try {
    byte[] utf16le = myString .getBytes("UTF-16");
    correct = new String(utf16le, "UTF-16");
} catch (UnsupportedEncodingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
System.out.println("str = "+correct);

Any help is appreciated.

Thanks

Vikas Goyal
  • 1,019
  • 1
  • 9
  • 12
  • Look at http://stackoverflow.com/questions/5857502/how-to-show-hindi-text-in-android and http://stackoverflow.com/questions/7789827/how-can-i-show-hindi-text-in-android-tablet – user370305 May 07 '12 at 07:20

0 Answers0