Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60237 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6995 invoked from network); 20 Apr 2012 15:27:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2012 15:27:46 -0000 Authentication-Results: pb1.pair.com header.from=john.lesueur@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=john.lesueur@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: john.lesueur@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:62209] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 22/17-63732-170819F4 for ; Fri, 20 Apr 2012 11:27:46 -0400 Received: by wibhr14 with SMTP id hr14so698036wib.11 for ; Fri, 20 Apr 2012 08:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dsOddTOxbmPzTUGECQDn3xqM7MnBbsVzmhtojdU4VIM=; b=KrG4D+pRkr3H/h3EG6pAZ1TONv+13sYVvXzloIrsbdUGELnm8z1HeEiJXiZLaxNRTr ZybZ0kFiNx1R237G6Hv1oEBB8aCEQ+Rl/LEyf1fqfz2hvtx7nnPB5YAdvzVpREY+Vxnw WVk/DaClqzjsDpzM/Qyti4Be8g571P79pPJ595k7kHVmUIJdpUXyOR1lhdY5LfN7TKDP BVqLQekePR0Ql1xnN4pP2JdrSPppbW7yXxzlFxcwB+fUVBgPUpoZOQ9YMRLlsGix7iFT 7g3cSwUr/qnY0sKGbhqzX3UE2YG00am52SFadE8ksM5M6T3+9zbbcJnqE3evp/+ry/VP xlSA== MIME-Version: 1.0 Received: by 10.180.91.10 with SMTP id ca10mr9057128wib.17.1334935662668; Fri, 20 Apr 2012 08:27:42 -0700 (PDT) Received: by 10.216.208.224 with HTTP; Fri, 20 Apr 2012 08:27:42 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 Apr 2012 09:27:42 -0600 Message-ID: To: Sherif Ramadan Cc: Arvids Godjuks , internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d043c093ef8ad4104be1ded9d Subject: Re: [PHP-DEV] Complete case-sensitivity in PHP From: john.lesueur@gmail.com (John LeSueur) --f46d043c093ef8ad4104be1ded9d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Apr 20, 2012 at 9:01 AM, Sherif Ramadan wr= ote: > >>Because you can write a function name, say, in Cyrilic and it will just > work. > > > > PHP deals with strings on a binary level though. To PHP a function > > name of =C1=E3=E7, for example is just a set of 256 bit encoded bytes. = So > > "\xc3\x81\xc3\xa3\xc3\xa7" is all it sees, right? I'm not sure I > > follow what the problem is. > > But in order to be case insensitive, PHP needs to know that strtolower("A") =3D=3D 'a'. So if you use Cyrilic for userland functions/classes, php needs= a cyrillic aware strtolower function. Then the problem is that core classes/functions need to use a plain ASCII strtolower for case insensitivity. So you cannot both write code in cyrillic and interface with plain ASCII internals. One possible, but less than optimal solution is to first try a locale aware strtolower, then try a plain ascii strtolower when looking up symbols. John --f46d043c093ef8ad4104be1ded9d--