title: How to convert the "Java modified UTF-8" to the regular UTF-8 and back?
body: <p>I have created a Java wrapper around a native C library and have a question about the string encodings. There are slight differences in the “Java modified UTF-8” encoding that is used by Java from the regular UTF-8. And these differences may cause serious problems: the JNI functions may crash the app when passed the regular UTF-8 because it may contain byte sequences forbidden for the “Java modified UTF-8”. Please see the following topic: <a href="https://stackoverflow.com/questions/7921016/what-does-it-mean-to-say-java-modified-utf-8-encoding">What does it mean to say &quot;Java Modified UTF-8 Encoding&quot;?</a></p>
  
  <p>My question is what is a standard reliable way to convert the “Java modified UTF-8” to the regular UTF-8 and back?</p>