title: NewString() & NewStringUTF() showing error not valid Modified UTF-8:
body: <p>I am trying to pass <code>char*</code> from C++ to java using JNI in android.
  I have tried number of ways to pass that data</p>
  
  <p>1) Using <code>NewStringUTF</code>:</p>
  
  <pre><code>const char* data = getData(); // this method returns a char array.
  env-&gt;NewStringUTF(data);
  </code></pre>
  
  <p>Executing above code throws below error</p>
  
  <pre><code>JNI WARNING: input is not valid Modified UTF-8: illegal continuation byte 0x70.
  </code></pre>
  
  <p>2)  Using <code>NewString</code>:</p>
  
  <pre><code>const char* data = getData(); // this method returns a char array.
  // passing a byte array to java
  jbyteArray trackIDArray = env-&gt;NewByteArray(strlen(data));
  env-&gt;SetByteArrayRegion(trackIDArray, 0, strlen(data), (const jbyte*)trackID);
  </code></pre>
  
  <p>On java side, I am getting some garbage value.  I don't understand how to get this <code>char</code> array to Java.</p>