title: How can i convert jstring to char array?
body: <p>I cannot convert jstring to char array</p>
  
  <pre><code>JNIEXPORT jlong JNICALL Java_com_jnitest_JNI_getUid(JNIEnv * env,jobject thiz,jstring user){
  const char *userName = (*env)-&gt;GetStringUTFChars(env,user,0);
  (*env)-&gt;ReleaseStringUTFChars(env,user,userName);
  FILE * f = fopen("/data/data/com.jnitest/p.txt","w");
  if(f != NULL){
      fprintf(f,"%c%c%c",userName[0],userName[1],userName[2]);
  fclose(f);
  }
  return getUser(userName);
  }
  </code></pre>
  
  <p>And in file p.txt i have this: <code>��</code></p>