Forums Register Login
Conversion from UTF16 to UTF8

We are trying to convert a UTF16 string to UTF8. Is there any Java API that will do the this conversion?

byte[] fooBytes = "foo".getBytes("UTF-8");
String foo = new String(fooBytes, "UTF-8");

This thread has been viewed 949 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 19, 2018 07:07:33.