Fix INITCAP() word boundaries for PG_UNICODE_FAST.
Jeff Davis <jdavis@postgresql.org>
Fix INITCAP() word boundaries for PG_UNICODE_FAST. Word boundaries are based on whether a character is alphanumeric or not. For the PG_UNICODE_FAST collation, alphanumeric includes non-ASCII digits; whereas for the PG_C_UTF8 collation, it only includes digits 0-9. Pass down the right information from the pg_locale_t into initcap_wbnext to differentiate the behavior. Reported-by: Noah Misch <noah@leadboat.com> Reviewed-by: Noah Misch <noah@leadboat.com> Discussion: https://postgr.es/m/20250417135841.33.nmisch@google.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/pg_locale_builtin.c | modified | +3 −1 |
| src/common/unicode/case_test.c | modified | +12 −1 |
| src/test/regress/expected/collate.utf8.out | modified | +6 −2 |
| src/test/regress/sql/collate.utf8.sql | modified | +2 −0 |
Discussion
- Unicode full case mapping: PG_UNICODE_FAST, and standard-compliant UCS_BASIC 9 messages · 2024-12-11 → 2025-04-20