Re: What "Unicode support" really means

From: Date: Wed, 05 Mar 2014 21:25:56 +0000
Subject: Re: What "Unicode support" really means
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-72944@lists.php.net to get a copy of this message
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 -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine

« previous php.internals (#72944) next »