#18556 [Ver->Ctl]: Setting locale to 'tr_TR' lowercases class names
| From: | iliaa@php.net | Date: | Thu, 26 Sep 2002 18:20:53 +0000 |
| Subject: | #18556 [Ver->Ctl]: Setting locale to 'tr_TR' lowercases class names | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-20468@lists.php.net to get a copy of this message | ||
ID: 18556
Updated by: iliaa@php.net
Reported By: spud@nothingness.org
-Status: Verified
+Status: Critical
Bug Type: Scripting Engine problem
Operating System: Linux (RedHat 7.2)
PHP Version: 4.2.2,4.3.0-dev
Assigned To: hholzgra
Previous Comments:
------------------------------------------------------------------------
[2002-09-23 07:31:30] sniper@php.net
Verified with latest CVS head. The example script outputs:
Instantiating an infoBlob with a lowercase i<br>Foo<br>Instantiating an
InfoBlob with an uppercase I<br>
Fatal error: Cannot instantiate non-existent class: ýnfoblob in t.php
on line 18
t.php(18) : Fatal error - Cannot instantiate non-existent class:
ýnfoblob
------------------------------------------------------------------------
[2002-08-28 21:12:13] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Something related to this was fixed in CVS. (the #16865 which this one
was marked duplicate of is closed)
------------------------------------------------------------------------
[2002-07-25 04:38:08] sniper@php.net
dup of #16865
------------------------------------------------------------------------
[2002-07-25 03:57:43] hholzgra@php.net
known problem, see regression test case tests/lang/035.phpt
------------------------------------------------------------------------
[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