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