[jdk17u-dev] RFR: 8272352: Java launcher can not parse Chinese character when system locale is set to UTF-8

Christoph Langer clanger at openjdk.org
Thu Jul 7 10:41:48 UTC 2022


On Wed, 6 Jul 2022 17:06:35 GMT, Stephanie Crater <duke at openjdk.org> wrote:

>> Backport to allow java to correctly parse Chinese characters in file paths and string arguments passed to java.exe.
>> 
>> 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`.
>
> @naotoj Backporting this issue to jdk17u and planning to backport to jdk11u as well - would you be willing to sponsor upon approval?

Hi, @calderast, could you please enable GHA on your repo that we get the sanity checks for this PR? Thanks!

-------------

PR: https://git.openjdk.org/jdk17u-dev/pull/530


More information about the jdk-updates-dev mailing list