1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-26 09:41:40 +03:00

Avoid global LC_CTYPE dependency in pg_locale_icu.c.

ICU still depends on libc for compatibility with certain historical
behavior for single-byte encodings. Make the dependency explicit by
holding a locale_t object when required.

We should consider a better solution in the future, such as decoding
the text to UTF-32 and using u_tolower(). That would be a behavior
change and require additional infrastructure though; so for now, just
avoid the global LC_CTYPE dependency.

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/450ceb6260cad30d7afdf155d991a9caafee7c0d.camel@j-davis.com
This commit is contained in:
Jeff Davis
2025-12-16 15:32:57 -08:00
parent 87b2968df0
commit 0a90df58cf
2 changed files with 44 additions and 4 deletions

View File

@@ -167,6 +167,7 @@ struct pg_locale_struct
{
const char *locale;
UCollator *ucol;
locale_t lt;
} icu;
#endif
};