• Post Reply Bookmark Topic Watch Topic
  • New Topic

Conversion from UTF16 to UTF8  RSS feed

 
coumaravel Cattavarayane
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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

Thanks
Coumar
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
byte[] fooBytes = "foo".getBytes("UTF-8");
String foo = new String(fooBytes, "UTF-8");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!