On 01/25/2007 05:04 PM, Tomas Kuliavas wrote:
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.

PHP needs locale insensitive strcasecmp() or your developers will continue
hitting string comparison issues in Turkish and Azerbaijani. Ilia patched
it in timezone parsing code. Some day other strcasecmp will pop in other
place.

Switching locale everytime you want to compare strings is a hack and not a
bug fix.

I did not and I do not like it either, but it fixes the problem and does not 
introduce any new issues (anymore).
If you think it's wrong and you have a better patch - send it to the list and 
we'll discuss it together.

--
Wbr, Antony Dovgal

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to