#42526 [Opn->Bgs]: Broken classes and method names in Turkish locale

From: Date: Mon, 03 Sep 2007 07:56:54 +0000
Subject: #42526 [Opn->Bgs]: Broken classes and method names in Turkish locale
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116989@lists.php.net to get a copy of this message
ID: 42526 Updated by: jani@php.net Reported By: tokul at users dot sourceforge dot net -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux Debian Etch PHP Version: 5CVS-2007-09-03 (snap) New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Same as bug #35050 (read the last comment..) Previous Comments: ------------------------------------------------------------------------ [2007-09-03 06:32:22] tokul at users dot sourceforge dot net Description: ------------ PHP zend_str_tolower() is locale insensitive on Windows and locale (LC_CTYPE) sensitive on other platforms. It causes case sensitivity problems in class and method names with Turkish locale on Linux, because Turkish locale has case sensitivity rules that differ from US English rules. Programmers make mistake by assuming that Latin small letter i is always equal to Latin capital letter i. Issue can be fixed by writing tolower() function alternative that is not LC_CTYPE sensitive. My tests show that if zend_str_tolower() is modified to do locale insensitive case conversion, basic PHP install passes 'make test' without any additional issues and Zend/bench.php does not show performance decrease. My code modifications are based on program licensed under GPL. locale insensitive tolower() takes only 5 lines in C. I can post link to patch, if you can use GPL code. If you can't do that, I can explain your programmers how locale insensitive tolower() works and you can write own function. I know about 40086, 35583, 35050 and 18556 bug reports, but these bug reports are closed and it looks strange, if you don't fix the issue when interpreter works correctly on Windows and BSD and fix takes less than 10 lines. Tested PHP 5.2-200709030430 and PHP6-200709030430 (unicode.semantics = off) snapshot. PHP6-200709030430 with unicode.semantics=on is not affected. If you have other open bug report on this issue, please give its number. Reproduce code: --------------- class TestIt { } class testclass2 { function TestItToo() {} } var_dump(setlocale(LC_ALL,'tr_TR.UTF-8')); var_dump(class_exists('TestIt')); $TestObj = new testclass2(); var_dump(method_exists($TestObj,'TestItToo')); Expected result: ---------------- string(11) "tr_TR.UTF-8" bool(true) bool(true) Actual result: -------------- string(11) "tr_TR.UTF-8" bool(false) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42526&edit=1

« previous php.bugs (#116989) next »