src/windows/native/sun/util/locale/provider/HostLocaleProviderAdapter_md.c

Print this page
rev 6663 : imported patch 8008576

@@ -609,11 +609,16 @@
     }
 }
 
 int getLocaleInfoWrapper(const jchar *langtag, LCTYPE type, LPWSTR data, int buflen) {
     if (pGetLocaleInfoEx) {
+        if (wcscmp(L"und", (LPWSTR)langtag) == 0) {
+            // defaults to "en"
+            return pGetLocaleInfoEx(L"en", type, data, buflen);
+        } else {
         return pGetLocaleInfoEx((LPWSTR)langtag, type, data, buflen);
+        }
     } else {
         // If we ever wanted to support WinXP, we will need extra module from
         // MS...
         // return GetLocaleInfo(DownlevelLocaleNameToLCID(langtag, 0), type, data, buflen);
         return 0;

@@ -620,11 +625,16 @@
     }
 }
 
 int getCalendarInfoWrapper(const jchar *langtag, CALID id, LPCWSTR reserved, CALTYPE type, LPWSTR data, int buflen, LPDWORD val) {
     if (pGetCalendarInfoEx) {
+        if (wcscmp(L"und", (LPWSTR)langtag) == 0) {
+            // defaults to "en"
+            return pGetCalendarInfoEx(L"en", id, reserved, type, data, buflen, val);
+        } else {
         return pGetCalendarInfoEx((LPWSTR)langtag, id, reserved, type, data, buflen, val);
+        }
     } else {
         // If we ever wanted to support WinXP, we will need extra module from
         // MS...
         // return GetCalendarInfo(DownlevelLocaleNameToLCID(langtag, 0), ...);
         return 0;