File tree Expand file tree Collapse file tree 1 file changed +2
-31
lines changed
Expand file tree Collapse file tree 1 file changed +2
-31
lines changed Original file line number Diff line number Diff line change @@ -2354,42 +2354,13 @@ icu_validate_locale(const char *loc_str)
23542354}
23552355
23562356/*
2357- * Determine default ICU locale by opening the default collator and reading
2358- * its locale.
2359- *
2360- * NB: The default collator (opened using NULL) is different from the collator
2361- * for the root locale (opened with "", "und", or "root"). The former depends
2362- * on the environment (useful at initdb time) and the latter does not.
2357+ * Determine the default ICU locale
23632358 */
23642359static char *
23652360default_icu_locale (void )
23662361{
23672362#ifdef USE_ICU
2368- UCollator * collator ;
2369- UErrorCode status ;
2370- const char * valid_locale ;
2371- char * default_locale ;
2372-
2373- status = U_ZERO_ERROR ;
2374- collator = ucol_open (NULL , & status );
2375- if (U_FAILURE (status ))
2376- pg_fatal ("could not open collator for default locale: %s" ,
2377- u_errorName (status ));
2378-
2379- status = U_ZERO_ERROR ;
2380- valid_locale = ucol_getLocaleByType (collator , ULOC_VALID_LOCALE ,
2381- & status );
2382- if (U_FAILURE (status ))
2383- {
2384- ucol_close (collator );
2385- pg_fatal ("could not determine default ICU locale" );
2386- }
2387-
2388- default_locale = pg_strdup (valid_locale );
2389-
2390- ucol_close (collator );
2391-
2392- return default_locale ;
2363+ return pg_strdup (uloc_getDefault ());
23932364#else
23942365 pg_fatal ("ICU is not supported in this build" );
23952366#endif
You can’t perform that action at this time.
0 commit comments