[jdk17u-dev] Integrated: 8272352: Java launcher can not parse Chinese character when system locale is set to UTF-8
Stephanie Crater
duke at openjdk.org
Mon Jul 11 18:23:58 UTC 2022
On Tue, 5 Jul 2022 17:44:08 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`.
This pull request has now been integrated.
Changeset: 011b96c3
Author: Stephanie Crater <scrater at microsoft.com>
Committer: Christoph Langer <clanger at openjdk.org>
URL: https://git.openjdk.org/jdk17u-dev/commit/011b96c37e694aca5ee82277d0634b843320d8f6
Stats: 15 lines in 1 file changed: 6 ins; 4 del; 5 mod
8272352: Java launcher can not parse Chinese character when system locale is set to UTF-8
Backport-of: 229344853126692d38ff7cb164dd5d17c5bf7fbb
-------------
PR: https://git.openjdk.org/jdk17u-dev/pull/530
More information about the jdk-updates-dev
mailing list