Re: Unicode Implementation
| From: | Derick Rethans | Date: | Fri, 07 Oct 2005 20:35:00 +0000 |
| Subject: | Re: Unicode Implementation | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19483@lists.php.net to get a copy of this message | ||
On Thu, 6 Oct 2005, Andrei Zmievski wrote:
> On Oct 6, 2005, at 10:56 AM, Derick Rethans wrote:
> >
> > I think I would prefer an IS_UNICODE/unicode=on only PHP.
> >
> > This would mean that:
> > - no duplicate functionality for tons of functions that will make
> > maintaining the thing very hard
>
> This is true.
>
> > - a cleaner (and a bit faster) Unicode implementation
>
> This is true too.
>
> > - we have a bit less BC.
>
> "A bit less"? I'd say it would break BC in a major way. People who want to
> upgrade to PHP 6 would need to rewrite a lot of their scripts.
Can you please specify which things you think that will break? I've gave
it some thoughts but couldn't really think of anything serious...
> > This is something I find quite not acceptable, and we need to figure
> > out a way on how to optimize this - for substr the penalty is
> > probably what we are using an iterator and not a direct memcpy
> > (because of surrogates), I am not so sure about the others.
>
> We can try switching to _UNSAFE versions of the iterator macros - they
> assume well-formed UTF-16, so they will be somewhat faster.
That's worth a try - I'll put that on my todo list somewhere.
Derick
--
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org