I have a UTF-16LE encoded string that comes from a server. I would like to print that string in Textview of my activity. However, the string prints with spaces in between them. So, “Hello” prints as “H e l l o” and doesn’t look all that nice in my screen.
Any help is appreciated.
Thanks
Assuming you have a stream (or array of
bytes) containing a UTF-16LE encoded string.If you do not convert these back & stating the character set used you will be producing a string containing a lot of 0-bytes (UTF-16LE is, obviously, 16-bit) in your resulting String.
Note: If you dump crap String:s like these into a TextView in ICS it will remove the garbage for you and not print “H e l l o”.