Re: What "Unicode support" really means

From: Date: Thu, 06 Mar 2014 08:46:18 +0000
Subject: Re: What "Unicode support" really means
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-72963@lists.php.net to get a copy of this message
On 06/03/2014 07:56, Crypto Compress wrote:
And a second Q: Would "type juggling" allow for autoboxing into a second string type where needed (unicode-aware functions)?
Perl 5 does this, a bit, but the problem is you need to know the *current* encoding of the string *before* the conversion anyway, and if it turns out to have been mis-labelled, you'll get "invalid encoding" errors at unpredictable points in your program. If the user has to say "this string of bytes represents UTF-8, make a Unicode string out of it", it's at least obvious that that's where conversion will happen. Granted, we don't want the user having to write that for every single $_GET variable, though... -- Rowan Collins [IMSoP]

« previous php.internals (#72963) next »