Bug #18556: Setting locale to 'tr_TR' lowercases class names
From: spud at nothingness dot org Date: Thu, 25 Jul 2002 06:52:34 +0000 Subject: Bug #18556: Setting locale to 'tr_TR' lowercases class names Groups: php.bugs Request: Send a blank email to php-bugs+get-15126@lists.php.net to get a copy of this message
From: spud@nothingness.org
Operating system: Linux (RedHat 7.2)
PHP version: 4.2.2
PHP Bug Type: *Languages/Translation
Bug description: Setting locale to 'tr_TR' lowercases class names
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 bug report at http://bugs.php.net/?id=18556&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18556&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18556&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18556&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18556&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18556&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18556&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18556&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18556&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18556&r=globals
Thread (68 messages)
- Bug #18556 Updated: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 Updated: Setting locale to 'tr_TR' lowercases class names
- #18556 [Dup->Fbk]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Fbk->Ver]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Ver->Ctl]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Ctl->Csd]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Csd->Opn]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Opn->Asn]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Asn->Fbk]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- #18556 [NoF->Asn]: Setting locale to 'tr_TR' lowercases class names
- #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Asn]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Asn->Csd]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Com]: Setting locale to 'tr_TR' lowercases class names
- Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
| « previous | php.bugs (#15126) | next » |
|---|