Converting UTF-16LE to UTF-8
807569Aug 15 2006 — edited Aug 15 2006Hi Guys,
I've got a weird situation. I'm pulling data from a site that spits out results in UTF-16LE format (was able to determine that by looking at the header). The data shows up fine when I do a System.out.print(data_in), BUT when I try to save it (append) to a file that already has UTF-8 data, (or any file for that matter) I get gibberish. The reason this data is in UTF-16LE is because it may contain internationalized domains which use the more flexible encoding.
Now, is there any way I can easily convert the String data (which is just US characters pretty much) to UTF-8? I don't care if the non-us characters get replace with ? (there are none anyways).
I'm really stuck here.
Thanks!
Lucy