Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Conversion from UTF16 to UTF8  RSS feed

 
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
 
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");
 
I want my playground back. Here, I'll give you this tiny ad for it:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!