Re: Initcap works differently with different locale providers
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Alexander Korotkov <aekorotkov@gmail.com>, Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru>
Cc: pgsql-docs@lists.postgresql.org
Date: 2025-07-30T19:58:50Z
Lists: pgsql-docs
On Mon, 2025-07-28 at 13:20 +0300, Alexander Korotkov wrote: > I can confirm inicap works with libc and libicu as you stated. The > documentation patch looks good to me. I’ve written a commit message. > The REL_12_STABLE branch is not relevant anymore as it’s out of > support. I’m going to push this if no objections. Apologies for the late review. First, it doesn't mention the "builtin" provider, which uses the same word break rules as libc. Second, word boundaries can be complex, and I'm wondering if we should not be so precise about what ICU does or doesn't do. For instance, ICU has options like U_TITLECASE_ADJUST_TO_CASED, U_TITLECASE_NO_BREAK_ADJUSTMENT, etc.[1], and I'm not sure exactly which one of those we use. I'd prefer that we try to explain that INITCAP() is intended for convenient display, and the specific result should not be relied upon (at least for ICU; maybe for all providers). If you want specific word boundary rules, write your own function. Regards, Jeff Davis [1] https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/stringoptions_8h.html#a4975f537b9960f0330b233061ef0608d
Commits
-
Further clarify documentation for the initcap function
- f8ce9ed220b5 19 (unreleased) landed
-
Revert "Clarify documentation for the initcap function"
- 0edaaa8f2978 14.19 landed
- 06633271ec40 13.22 landed
- 098c27dee4c1 15.14 landed
- b862465dba33 16.10 landed
- 3b3aa1f651c7 17.6 landed
- 2ae8280d16c9 18.0 landed
-
Clarify documentation for the initcap function
- 907ac2ca30bb 13.22 landed
- 276b022ec05b 14.19 landed
- 9af075c4e27e 15.14 landed
- d861b9282261 16.10 landed
- 3c05d4d3433e 17.6 landed
- 1fe9e3822c4e 18.0 landed
- c2c2c7e22566 19 (unreleased) landed