Re: ICU locale validation / canonicalization

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ICU locale validation / canonicalization
Date: 2023-03-15 22:18:05
Message-ID: 7d77abd7767baaf30445e83415b428aa3eb54631.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2023-03-14 at 23:47 -0700, Jeff Davis wrote:
> On Tue, 2023-03-14 at 10:10 -0700, Jeff Davis wrote:
> > One loose end is that we really should support language tags like
> > "und"
> > in those older versions (54 and earlier). Your commit d72900bded
> > avoided the problem, but perhaps we should fix it by looking for
> > "und"
> > and replacing it with "root" while opening, or something.
>
> Attached are a few patches to implement this idea.

Here is an updated patch series that includes these earlier fixes for
older ICU versions, with the canonicalization patch last (0005).

I left out the validation patch for now, and I'm evaluating a different
approach that will attempt to match to the locales retrieved with
uloc_countAvailable()/uloc_getAvailable().

--
Jeff Davis
PostgreSQL Contributor Team - AWS

Attachment Content-Type Size
v5-0001-Support-language-tags-in-older-ICU-versions-53-an.patch text/x-patch 5.1 KB
v5-0002-Wrap-ICU-ucol_open.patch text/x-patch 4.0 KB
v5-0003-Handle-the-und-locale-in-ICU-versions-54-and-olde.patch text/x-patch 5.6 KB
v5-0004-Add-SQL-function-pg_icu_language_tag.patch text/x-patch 10.6 KB
v5-0005-Canonicalize-ICU-locale-names-to-language-tags.patch text/x-patch 16.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2023-03-15 22:18:28 Re: Add a hook to allow modification of the ldapbindpasswd
Previous Message Daniel Gustafsson 2023-03-15 22:17:12 Re: Memory leak in libxml2 (was Re: [PATCH] Add pretty-printed XML output option)