Re: [java-gnome-hackers] jcharArray, jbyteArray, jstring
Brought to you by:
afcowie
From: Tom B. <Tom...@Su...> - 2003-01-04 00:04:47
|
On Thu, 2002-12-26 at 06:54, Mark Howard wrote: > I've found that changing it to this fixes the problems (for me at least) > JNIEXPORT jint JNICALL Java_org_gnu_gtk_Label_gtk_1label_1new (JNIEnv > *env, jclass cls, jstring str) > { > const gchar *str_g = (*env)->GetStringUTFChars(env, str, 0); > { > return (jint)gtk_label_new (str_g); > } > } > Is this the best way to handle it? This approach makes the most sense, as GetStringUTFChars should hide any encoding issues both for US English and other locales, and the less we have to deal directly with I18N issues, the better. Let the runtime do it for us! Tom |