On Tue, Mar 16, 2010 at 6:32 PM, Rasmus Lerdorf <ras...@lerdorf.com> wrote:
> On 03/16/2010 10:40 AM, dreamcat four wrote:
>> As for text files on disk, if they are unicode, they are most commonly
>> utf-8 too. So then, why use utf-16 as internal unicode representation
>> in Php? It doesn't really make a lot of sense for most regular people
>> who want to use Php for their web application. Unless they don't
>> really care how slow its gonna be converting everything, constantly...
>
> Well, the obvious original reason is that ICU uses UTF-16 internally and
> the logic was that we would be going in and out of ICU to do all the
> various Unicode operations many more times than we would be interfacing
> with external things like MySQL or files on disk.  You generally only
> read or write a string once from an external source, but you may perform
> multiple Unicode operations on that same string so avoiding a conversion
> for each operation seems logical.
>
> -Rasmus
>
>
>

Its only logical if you've bothered to profile the conversion calls to
ICU against the non-ICU conversion calls. Im guessing the way to do
that, is to have 2 versions of each conversion method. One used by
ICU, and another used everywhere else. The harder part is to find some
suitable, real life php programs to test with.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to