Function lookup problem after calling setlocale(LC_ALL, "tr_TR")
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php |
Unknown
|
Unknown
|
|||
php5 (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: php5-cli
Ubuntu 8.10
php5-cli:
Installed: 5.2.6-2ubuntu4.1
Candidate: 5.2.6-2ubuntu4.1
Version table:
*** 5.2.6-2ubuntu4.1 0
500 http://
500 http://
100 /var/lib/
5.2.6-2ubuntu4 0
500 http://
Bug Details:
<?php
echo setlocale(LC_ALL, 'tr_TR')."\n";
HI5();
function HI5() { echo "Five!\n";}
?>
outputs the following:
---
tr_TR
Fatal error: Call to undefined function HI5() in...
---
Notes:
1. Make sure you have tr_TR locale installed, i.e. check the output of first echo statement.
2. The locale before executing the script must be different from tr_TR to repeat this case, e.g. en_US.utf-8
I can kind of confirm this bug. Actually I can only confirm this error for certain function names. For example, try replace HI5() with foo(), and everything should work as expected.
From my limited testing I've only ran into this problem when the function name contains a capital I.
Not entirely sure if this is a bug in PHP. While generating the tr_TR locale I received the following errors:
root@pc13267v3: /var/lib/ locales/ supported. d# echo "tr_TR ISO-8859-1" >> local /var/lib/ locales/ supported. d# locale-gen ISO-8859- 1... /usr/share/ i18n/locales/ tr_TR:1477: LC_MESSAGES: unknown character in field `nostr' i18n/locales/ tr_TR:1510: LC_TIME: unknown character in field `day' i18n/locales/ tr_TR:1525: LC_TIME: unknown character in field `mon' i18n/locales/ tr_TR:1531: LC_TIME: unknown character in field `mon' i18n/locales/ tr_TR:1532: LC_TIME: unknown character in field `mon' i18n/locales/ tr_TR:1567: LC_NAME: unknown character in field `name_gen' /var/lib/ locales/ supported. d#
root@pc13267v3:
Generating locales...
en_US.UTF-8... up-to-date
sv_SE.UTF-8... up-to-date
tr_TR.
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
failed
Generation complete.
root@pc13267v3:
All of the above applies to current versions of Ubuntu 8.04, 8.10 and 9.04.