v1-0001-initdb-prefer-UTF-8-encoding-over-SQL_ASCII.patch
text/x-patch
Filename: v1-0001-initdb-prefer-UTF-8-encoding-over-SQL_ASCII.patch
Type: text/x-patch
Part: 0
From 9c8cf58c541462a6aef43fed0ddea1e9f1633960 Mon Sep 17 00:00:00 2001 From: Jeff Davis <jeff@j-davis.com> Date: Fri, 31 Oct 2025 13:36:46 -0700 Subject: [PATCH v1 1/2] initdb: prefer UTF-8 encoding over SQL_ASCII. This was already true for the ICU locale provider, make it true for the others. --- src/bin/initdb/initdb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 92fe2f531f7..aa7fc5a6636 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -2718,10 +2718,10 @@ setup_locale_encoding(void) ctype_enc = pg_get_encoding_from_locale(lc_ctype, true); /* - * If ctype_enc=SQL_ASCII, it's compatible with any encoding. ICU does - * not support SQL_ASCII, so select UTF-8 instead. + * If ctype_enc=SQL_ASCII, it's compatible with any encoding. Prefer + * UTF-8. */ - if (locale_provider == COLLPROVIDER_ICU && ctype_enc == PG_SQL_ASCII) + if (ctype_enc == PG_SQL_ASCII) ctype_enc = PG_UTF8; if (ctype_enc == -1) -- 2.43.0