Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27648 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97875 invoked by uid 1010); 25 Jan 2007 14:33:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97856 invoked from network); 25 Jan 2007 14:33:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2007 14:33:50 -0000 Authentication-Results: pb1.pair.com header.from=antony@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=antony@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: antony@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:32967] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/68-13597-C1BB8B54 for ; Thu, 25 Jan 2007 09:13:50 -0500 Received: (qmail 4533 invoked from network); 25 Jan 2007 14:12:07 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 25 Jan 2007 14:12:07 -0000 Message-ID: <45B8BB19.3010605@zend.com> Date: Thu, 25 Jan 2007 17:13:45 +0300 User-Agent: Thunderbird 1.5.0.8 (X11/20061025) MIME-Version: 1.0 To: Tomas Kuliavas CC: internals@lists.php.net References: <0F741213-BCA4-4923-A83A-3E4E9C561DAE@prohost.org> <5F.94.13597.04698B54@pb1.pair.com> <45B897E5.40007@zend.com> <41936.195.22.180.233.1169730121.squirrel@avilys.eik.lt> <45B8B2E5.4010204@zend.com> <40869.195.22.180.233.1169733866.squirrel@avilys.eik.lt> In-Reply-To: <40869.195.22.180.233.1169733866.squirrel@avilys.eik.lt> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PHP 5.2.1RC3 Released From: antony@zend.com (Antony Dovgal) 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