From 859f6db87bacc38f0929bc64f44aa8501f361c5b Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 6 Aug 2009 15:08:11 +0200 Subject: Fix bug when comparing chars and ignoring case (with some locales) (bug #27190) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was a problem with some locales like turkish, where upper "i" is "İ". All IRC commands with "I" inside (JOIN, PRIVMSG, ..) failed with turkish locale. --- src/core/wee-utf8.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/wee-utf8.c b/src/core/wee-utf8.c index 9e43bce58..c07fddb19 100644 --- a/src/core/wee-utf8.c +++ b/src/core/wee-utf8.c @@ -457,10 +457,12 @@ utf8_charcasecmp (const char *string1, const char *string2) return (string1) ? 1 : ((string2) ? -1 : 0); wchar1 = utf8_wide_char (string1); - wchar1 = towlower (wchar1); + if ((wchar1 >= 'A') && (wchar1 <= 'Z')) + wchar1 += ('a' - 'A'); wchar2 = utf8_wide_char (string2); - wchar2 = towlower (wchar2); + if ((wchar2 >= 'A') && (wchar2 <= 'Z')) + wchar2 += ('a' - 'A'); return (wchar1 < wchar2) ? -1 : ((wchar1 == wchar2) ? 0 : 1); } -- cgit v1.2.3