#39993 [Asn]: tr_TR.UTF-8 locale has problems with PHP
| From: | iliaa@php.net | Date: | Sat, 30 Dec 2006 23:45:53 +0000 |
| Subject: | #39993 [Asn]: tr_TR.UTF-8 locale has problems with PHP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-107055@lists.php.net to get a copy of this message | ||
ID: 39993
Updated by: iliaa@php.net
Reported By: tunix at raptiye dot org
Status: Assigned
Bug Type: Date/time related
Operating System: Arch Linux
PHP Version: 5.2.0
Assigned To: derick
New Comment:
Another option that is a bit more performance friendly is
something like this:
http://bb.prohost.org/patch/date.txt
Previous Comments:
------------------------------------------------------------------------
[2006-12-30 23:08:23] tony2001@php.net
Its is reproducible with the snapshot.
I believe this happens because of strcasecmp() (used in
seek_to_tz_position()) behaving weird with tr_TR locale (I remember
some similar problems in the past), using something like tolower() &
memcmp() should do the trick.
------------------------------------------------------------------------
[2006-12-30 20:46:30] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-12-30 18:22:08] tunix at raptiye dot org
Description:
------------
I type
<?php echo date("l"); ?>
into an empty php file and then run it in command line prompt, and it
prints this error message:
Fatal error: date(): Timezone database is corrupt - this should *never*
happen! in Command line code on line 1
If I use tr_TR.UTF-8 locale, then I can produce this error. But if I
use tr_TR.ISO8859-9 or C locales, it doesn't print the error message.
Although, tr_TR.ISO8859-9 and C locales return Saturday which is
English. It should return "Cumartesi" (turkish).
GNU date command works fine with UTF-8 locale.
[19:07] (tunix@penguix ~)$ TZ=Europe/Istanbul LANG=tr_TR.UTF-8 date
+%A
Cumartesi
Reproduce code:
---------------
[19:06] (tunix@penguix ~)$ TZ=Europe/Istanbul LANG=tr_TR.UTF-8 php -r
date(l);
Fatal error: date(): Timezone database is corrupt - this should *never*
happen! in Command line code on line 1
Expected result:
----------------
It's supposed to be:
[19:06] (tunix@penguix ~)$ TZ=Europe/Istanbul LANG=tr_TR.UTF-8 php -r
date(l);
Cumartesi
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39993&edit=1