RE: [PHP-DEV] bug 18556 - tolower & locales

From: Date: Wed, 11 Jul 2012 09:57:16 +0000
Subject: RE: [PHP-DEV] bug 18556 - tolower & locales
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-61122@lists.php.net to get a copy of this message
Hi Nikita, That was my first problem with the code, too! I would make the Zend engine use the ROOT Locale for PHP's language parsing (in Java it's called Locale.ROOT, in C it’s the Locale named ""), so its invariant to local settings but works correct for all of Unicode. In theory, this "case insensitive matching" should *not* be done by lowercasing, in Unicode the correct way to do it is by "case folding", which is something different (but using the ROOT locale has almost the same effect). In general methods like Java's String.equalsIgnoreCase(String) do this internally. I don't think ASCII-only lowercasing is in-compatible to the allowed PHP identifier characters used by class names and what else. Uwe ----- Uwe Schindler thetaphi@php.net - http://www.php.net NSAPI SAPI developer Bremen, Germany > -----Original Message----- > From: Nikita Popov [mailto:nikita.ppv@gmail.com] > Sent: Wednesday, July 11, 2012 11:41 AM > To: Stas Malyshev > Cc: PHP Internals; Johannes Schlüter > Subject: Re: [PHP-DEV] bug 18556 - tolower & locales > > On Wed, Jul 11, 2012 at 7:40 AM, Stas Malyshev <smalyshev@sugarcrm.com> > wrote: > > Hi! > > > > I've prepared a fix for bug #18556 - see > > https://github.com/php/php-src/pull/126 > > A slight complication there is that for internal operations we > > probably want locale-independent lowercasing, while for regular string > > operations we probably want to stay with locale-depenedent one. That's > > how I implemented it, even though it adds a bit of complexity, but I > > think it's the best way to solve it. Any comments/objections/improvements? > > With this patch, will it still be possible to use foreign class names correctly? > Like writing them in Russian and expecting the case-insensitivity to work > correct? > > Nikita > > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: > http://www.php.net/unsub.php

« previous php.internals (#61122) next »