Re: ICU locale validation / canonicalization
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
On 10.02.23 18:53, Jeff Davis wrote: > To represent ICU locale strings in the catalog consistently, we have > two choices, which as far as I can tell are equivalent: > > 1. ICU format Locale IDs. These are more readable, and still specified > (albeit non-standard). > > 2. BCP47 language tags. These are standardized, there's better > validation with "strict" mode, and we are already using them. > > Honestly I don't think it's hugely important which one we pick. But > being consistent is important, so we need to pick one, and BCP 47 seems > like the better option to me. I found some discussion about this from when ICU support was first added. See this message as a starting point: https://www.postgresql.org/message-id/flat/5291804b-169e-3ba9-fdaf-fae8e7d2d959%402ndquadrant.com#96acb7eb9299c2ca64dbabcf58e11a90 There isn't much detail there, but the discussion and the current code seem pretty convinced that a) BCP47 tags are preferred, and b) They don't work with ICU versions before 54. I can't locate the source for claim b) anymore. However, it seems pretty clear that there is some cutoff, even if it isn't exactly 54. I would support transitioning this forward somehow, but we would need to know exactly what the impact would be.
Commits
-
Add missing source file to nls.mk
- b8c3f6df85e7 16.0 cited
-
Fix MSVC warning introduced in ea1db8ae70.
- 36320cbc164a 16.0 landed
-
Canonicalize ICU locale names to language tags.
- ea1db8ae70e5 16.0 landed
-
Validate ICU locales.
- 1671f990dd66 16.0 landed
-
initdb: emit message when using default ICU locale.
- c1f1c1f87fd6 16.0 landed
-
initdb: replace check_icu_locale() with default_icu_locale().
- f8ca22295e99 16.0 landed
-
Fix error inconsistency in older ICU versions.
- 8b3eb0c584be 16.0 landed
-
Avoid potential UCollator leak for older ICU versions.
- a03b3b6b4a72 16.0 landed
-
pg_locale.c: change ereport() to elog().
- 9a242899158c 16.0 landed
-
Handle the "und" locale in ICU versions 54 and older.
- 3b50275b1295 16.0 landed
-
Wrap ICU ucol_open().
- a326aac8f171 16.0 landed
-
Support language tags in older ICU versions (53 and earlier).
- 869650fa86ad 16.0 landed
-
Improve support for UNICODE collation on older ICU
- d72900bdedc6 16.0 cited
-
Use ICU by default at initdb time.
- 27b62377b47f 16.0 cited