8198697: Simplify initialization of platform encoding

Reviewed-by: redestad, sherman
This commit is contained in:
Roger Riggs 2018-03-02 14:17:04 -05:00
parent b64d0ef66d
commit c43cebb5cf
3 changed files with 61 additions and 77 deletions

View file

@ -260,7 +260,6 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
PUTPROP(props, "user.variant", sprops->variant);
}
PUTPROP(props, "file.encoding", sprops->encoding);
PUTPROP(props, "sun.jnu.encoding", sprops->sun_jnu_encoding);
if (sprops->sun_stdout_encoding != NULL) {
PUTPROP(props, "sun.stdout.encoding", sprops->sun_stdout_encoding);
}
@ -319,6 +318,7 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
/* !!! DO NOT call PUTPROP_ForPlatformNString before this line !!!
* !!! I18n properties have not been set up yet !!!
*/
InitializeEncoding(env, sprops->sun_jnu_encoding);
/* Printing properties */
/* Note: java.awt.printerjob is an implementation private property which
@ -418,6 +418,9 @@ Java_java_lang_System_initProperties(JNIEnv *env, jclass cla, jobject props)
(*env)->DeleteLocalRef(env, jVMVal);
}
// Platform defined encoding properties override any on the command line
PUTPROP(props, "sun.jnu.encoding", sprops->sun_jnu_encoding);
return ret;
}