Bug #18556 Updated: Setting locale to 'tr_TR' lowercases class names

From: Date: Thu, 25 Jul 2002 07:57:43 +0000
Subject: Bug #18556 Updated: Setting locale to 'tr_TR' lowercases class names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15131@lists.php.net to get a copy of this message
ID: 18556 Updated by: hholzgra@php.net Reported By: spud@nothingness.org -Status: Open +Status: Analyzed Bug Type: *Languages/Translation Operating System: Linux (RedHat 7.2) PHP Version: 4.2.2 -Assigned To: +Assigned To: hholzgra New Comment: known problem, see regression test case tests/lang/035.phpt Previous Comments: ------------------------------------------------------------------------ [2002-07-25 02:52:33] spud@nothingness.org This bug is related to others submitted that refer to _constants_ being affected by the locale change, but since this actually concerns a class name, I wanted to submit it separately. Pardon the error if it turns out to be one... I'm internationalizing an app, which loads (include_once) a file called 'imc_Info.inc' containing two class definitions with their respective constructors: class Info and class InfoOracle In the course of loading the index page, I call new InfoOracle() and perform a query. This works fine in English, Spanish, French, and Greek. If I switch my app's locale to Turkish ('tr_TR'), however, I get a error: Cannot instantiate non-existent class: ?acle in /var/www/html (Yes, that ? appears in my logs). After searching for bug reports concerning Turkish, I noticed some closed/bogus reports that mentioned _case_, so I did some poking around. Although my class constructor clearly reads function InfoOracle() { blah blah blah } PHP fails to acknowledge it. The get_declared_classes() function DOES return "info" and "infooracle" in its array though. So I tried changing my call to new infooracle(), simply lowercasing the whole name. That worked like a charm, in Turkish. I noticed in one of the other bug reports that Turkish contains no "I" in its character set, which _sort of_ explains the problem, but it still strikes me as a bug. Shouldn't class names remain unaffected by the current locale? The following script demonstrates the problem. It generates the first output, then throws an error attempting the second. ---- SCRIPT ---- <? // Set language to desired language $g_lang = 'tr_TR'; putenv("LANG=$g_lang"); setlocale(LC_ALL, $g_lang); class InfoBlob { var $foo; function InfoBlob() { $this->foo = "Foo"; } } echo ('Instantiating an infoBlob with a lowercase i<br>'); $foobar = new infoBlob(); echo ($foobar->foo); echo ('<br>Instantiating an InfoBlob with an uppercase I<br>'); $foobar = new InfoBlob(); echo ($foobar->foo); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18556&edit=1

« previous php.bugs (#15131) next »