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/interfaces/libpq/fe-exec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/interfaces/libpq/fe-exec.c') diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 6e8c2153e0a..1da5bc1ad65 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.158 2004/03/14 22:00:54 tgl Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.159 2004/05/07 00:24:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1904,8 +1904,7 @@ PQfnumber(const PGresult *res, const char *field_name) } else { - if (isupper((unsigned char) c)) - c = tolower((unsigned char) c); + c = pg_tolower((unsigned char) c); *optr++ = c; } } -- cgit v1.2.3