Re: [Discussion] Scalar Object Strings and MultibyteEncodings

From: Date: Thu, 20 Jun 2019 22:30:34 +0000
Subject: Re: [Discussion] Scalar Object Strings and MultibyteEncodings
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-106011@lists.php.net to get a copy of this message
On 20/06/2019 22:19, Rowan Collins wrote:
On 20/06/2019 16:36, Mark Randall wrote:
"Hello".substr(1) // would work as expected regardless of encoding
As I always point out when "multi-byte support" or "Unicode support" is discussed, it's often ambiguous just what should be "expected". My point is that any attempt to make the language "do the right thing by default" needs serious thought on what "the right thing" is.
Without a doubt, and I expect people will have terrible flashbacks to PHP6 discussions when thinking about it. It will require a consensus of which I have no power to aid or influence. There does at least seem to be the starting point in that mb_string is already widely used, and my suggestion that it "work as expected" is more that it would work as the equivalent mb_string / iconv function would. mb_strlen returns the number of codepoints for example, I'm not immediately seeing anything about mb_string supporting Graphemes as the only reference I could find to their manipulation was The intl extension. -- Mark Randall

« previous php.internals (#106011) next »