On 01/25/2007 04:02 PM, Tomas Kuliavas wrote:
Test script:
---
<?php
// Set all locale vars
var_dump(setlocale(LC_ALL,'tr_TR.UTF-8'));
// get default timezone
var_dump(date_default_timezone_get());
// get current LC_CTYPE value
var_dump(setlocale(LC_CTYPE,0));
---
Expected result:
---
string(11) "tr_TR.UTF-8"
string(15) "Europe/Helsinki"
string(11) "tr_TR.UTF-8"
---
Result after Iliaa's patch:
---
string(11) "tr_TR.UTF-8"
string(15) "Europe/Helsinki"
string(1) "C"
---
Ok, this is now fixed.
Is it that difficult to replace strcasecmp with locale independent case
insensitive comparison function?
We're open for patches. Feel free to send one.
I am PHP developer and don't code in C. In PHP script locale insensitive
strtolower/strtoupper can be done with one preg_replace call.
Making PCRE a requirement for ext/date is not an option.
All timezone identifiers are written in plain US-ASCII. Lowercase ASCII
characters are in 0x61-0x7A range, uppercase characters are in 0x41-0x5A.
Maybe you can add 0x20 to all 0x41-0x5A byte values and use strcmp()
instead of strcasecmp().
Looks way overcomplicated comparing to the Ilia's solution.
--
Wbr,
Antony Dovgal
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php