How to convert jstring (JNI) to std::string (c++) with utf8 characters?
jstring
std::string
utf8
this is my code. it worked with non-utf8 characters, but i
jboolean isCopy; const char *convertedValue = (env)->GetStringUTFChars(yourJStringParam, &isCopy); std::string string = std::string(convertedValue, length)
This works just fine. Give it a try.