Let\'s say that on the C++ side my function takes a variable of type jstring named myString. I can convert it to an ANSI string as follows:
jstring
myString
Rather simple. But do not forget to free the memory by ReleaseStringChars
JNIEXPORT jboolean JNICALL Java_TestClass_test(JNIEnv * env, jobject, jstring string) { const wchar_t * utf16 = (wchar_t *)env->GetStringChars(string, NULL); ... env->ReleaseStringChars(string, utf16); }