Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is that true that JNI can't handle chinese characters at all?

843829Jan 28 2002 — edited Mar 22 2002
I'v tried many way to solve the problem but got no result.

As I input Chinese args and read it in my C code like this:

char docfile = (char)(*env)->GetStringUTFChars(env, jsdocfile, NULL);

I got "????" as result.

And when C native return a char* with Chinese characters in it, I got "????" too!

C Code:
jstring jstr = (*env)->NewStringUTF(env, result);
or
jstring jstr = (*env)->NewString(env, result,strlen(result));

I've search the forum, EVERY topic about JNI and Chinese or Japanese is not really solved the problem.

Is java really support Chinese in JNI?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2002
Added on Jan 28 2002
3 comments
399 views