From 0bd61548ab8d1ac5fee63f48ee9b384502a51ad6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 7 May 2004 00:24:59 +0000 Subject: Solve the 'Turkish problem' with undesirable locale behavior for case conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale. --- src/backend/utils/adt/encode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/encode.c') diff --git a/src/backend/utils/adt/encode.c b/src/backend/utils/adt/encode.c index e7edc83f6fd..488afa09666 100644 --- a/src/backend/utils/adt/encode.c +++ b/src/backend/utils/adt/encode.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.10 2003/11/29 19:51:58 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.11 2004/05/07 00:24:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -549,7 +549,7 @@ pg_find_encoding(const char *name) int i; for (i = 0; enclist[i].name; i++) - if (strcasecmp(enclist[i].name, name) == 0) + if (pg_strcasecmp(enclist[i].name, name) == 0) return &enclist[i].enc; return NULL; -- cgit v1.2.3