diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-08-06 15:08:11 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-08-06 15:08:11 +0200 |
commit | 859f6db87bacc38f0929bc64f44aa8501f361c5b (patch) | |
tree | 2d4b8f77227ff21018332755fae64862b455fd1d /src | |
parent | acef1477751c71c078df10891a1a0124f46b79e6 (diff) | |
download | weechat-859f6db87bacc38f0929bc64f44aa8501f361c5b.zip |
Fix bug when comparing chars and ignoring case (with some locales) (bug #27190)
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/wee-utf8.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); } |