Re: What "Unicode support" really means

From: Date: Wed, 05 Mar 2014 21:31:32 +0000
Subject: Re: What "Unicode support" really means
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-72946@lists.php.net to get a copy of this message
Am 05.03.2014 22:25, schrieb Derick Rethans:
On Wed, 5 Mar 2014, Andrea Faulds wrote:
On 5 Mar 2014, at 21:07, Derick Rethans <derick@php.net> wrote:
Well, even with UTF-32 (4 bytes for every character) it is not so easy to calculate the number of "characters". Characters can also be combined from multiple Unicode Codepoints, so even Å (U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE) can also be a combination of U+0041 LATIN CAPITAL LETTER A + U+030A COMBINING RING ABOVE. So things like substr, and wordwrap would have to deal with that too, making the "performance benefits" of UTF-32 largely go away.
Are we sure we want substr() to operate on printed characters and not codepoints?
Yes, as it makes no sense to see this: A, if you really mean Å. There are different ways to make this better though, for example by converting to NFC before operations—but that's not always possible for every combination. cheers, Derick
functions should be flavored: "grapheme clusters", "codepoints" (only internal?), "bytes"

« previous php.internals (#72946) next »