< prev index next >

src/share/native/java/io/io_util.c

Print this page
rev 1551 : 8057530: (process) Runtime.exec throws garbled message in jp locale
8016579: (process) IOException thrown by ProcessBuilder.start() method is incorrectly encoded
Reviewed-by: alanb

*** 204,220 **** void throwFileNotFoundException(JNIEnv *env, jstring path) { char buf[256]; ! jint n; jobject x; jstring why = NULL; ! n = JVM_GetLastErrorString(buf, sizeof(buf)); if (n > 0) { why = JNU_NewStringPlatform(env, buf); } x = JNU_NewObjectByName(env, "java/io/FileNotFoundException", "(Ljava/lang/String;Ljava/lang/String;)V", path, why); --- 204,224 ---- void throwFileNotFoundException(JNIEnv *env, jstring path) { char buf[256]; ! size_t n; jobject x; jstring why = NULL; ! n = getLastErrorString(buf, sizeof(buf)); if (n > 0) { + #ifdef WIN32 + why = (*env)->NewStringUTF(env, buf); + #else why = JNU_NewStringPlatform(env, buf); + #endif } x = JNU_NewObjectByName(env, "java/io/FileNotFoundException", "(Ljava/lang/String;Ljava/lang/String;)V", path, why);
< prev index next >