Java runtime has been detecting the Windows system locale encoding using `GetLocaleInfo(GetSystemDefaultLCID(), LOCALE_IDEFAULTANSICODEPAGE, ...)`, but it returns the *legacy* ANSI code page value, e.g, 1252 for US-English. In order to detect whether the user has selected `UTF-8` as the default, the code page has to be queried with `GetACP()`. Also, the case if the call to `GetLocaleInfo` fails changed to fall back to `UTF-8` instead of `Cp1252`.
------------- Commit messages: - 8272352: Java launcher can not parse Chinese character when system locale is set to UTF-8 Changes: https://git.openjdk.java.net/jdk/pull/8434/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8434&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8272352 Stats: 13 lines in 1 file changed: 3 ins; 4 del; 6 mod Patch: https://git.openjdk.java.net/jdk/pull/8434.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/8434/head:pull/8434 PR: https://git.openjdk.java.net/jdk/pull/8434