Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83678 invoked by uid 1010); 25 Jan 2007 13:38:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 83663 invoked from network); 25 Jan 2007 13:38:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2007 13:38:52 -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:1708] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/A7-13597-AE2B8B54 for ; Thu, 25 Jan 2007 08:38:52 -0500 Received: (qmail 28632 invoked from network); 25 Jan 2007 13:37: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 13:37:07 -0000 Message-ID: <45B8B2E5.4010204@zend.com> Date: Thu, 25 Jan 2007 16:38: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> In-Reply-To: <41936.195.22.180.233.1169730121.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 04:02 PM, Tomas Kuliavas wrote: > Test script: > --- > // 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