On Fri, Apr 20, 2012 at 9:01 AM, Sherif Ramadan <theanomaly...@gmail.com>wrote:

> >>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 Áãç, 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")
== '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

Reply via email to