changeset 57907:44cc199fac64

8238203: Return value of GetUserDefaultUILanguage() should be handled as LANGID Reviewed-by: naoto
author ysuenaga
date Sun, 02 Feb 2020 18:35:28 +0100
parents a2320a988013
children 1dba80ef03e9
files src/java.base/windows/native/libjava/java_props_md.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/windows/native/libjava/java_props_md.c	Sat Feb 01 09:55:03 2020 +0100
+++ b/src/java.base/windows/native/libjava/java_props_md.c	Sun Feb 02 18:35:28 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -641,7 +641,8 @@
          */
         LCID userDefaultLCID = GetUserDefaultLCID();
         LCID systemDefaultLCID = GetSystemDefaultLCID();
-        LCID userDefaultUILang = GetUserDefaultUILanguage();
+        LANGID userDefaultUILang = GetUserDefaultUILanguage();
+        LCID userDefaultUILCID = MAKELCID(userDefaultUILang, SORTIDFROMLCID(userDefaultLCID));
 
         {
             char * display_encoding;
@@ -655,8 +656,8 @@
             // for the UI Language, if the "language" portion of those
             // two locales are the same.
             if (PRIMARYLANGID(LANGIDFROMLCID(userDefaultLCID)) ==
-                PRIMARYLANGID(LANGIDFROMLCID(userDefaultUILang))) {
-                userDefaultUILang = userDefaultLCID;
+                PRIMARYLANGID(userDefaultUILang)) {
+                userDefaultUILCID = userDefaultLCID;
             }
 
             SetupI18nProps(userDefaultLCID,
@@ -665,7 +666,7 @@
                            &sprops.format_country,
                            &sprops.format_variant,
                            &sprops.encoding);
-            SetupI18nProps(userDefaultUILang,
+            SetupI18nProps(userDefaultUILCID,
                            &sprops.display_language,
                            &sprops.display_script,
                            &sprops.display_country,