Re: What "Unicode support" really means
| From: | Crypto Compress | 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:functions should be flavored: "grapheme clusters", "codepoints" (only internal?), "bytes"On 5 Mar 2014, at 21:07, Derick Rethans <derick@php.net> wrote: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, DerickWell, 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?