Re: Re: PHP 5.2.1RC3 Released

From: Date: Thu, 25 Jan 2007 14:35:30 +0000
Subject: Re: Re: PHP 5.2.1RC3 Released
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-27649@lists.php.net to get a copy of this message
On Thu, 25 Jan 2007, 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 actually agree there and it was one of the reasons why I didn't like this patch. However, it is the quickest way to do this for now. regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

« previous php.internals (#27649) next »