Re: What "Unicode support" really means

From: Date: Wed, 05 Mar 2014 21:17:48 +0000
Subject: Re: What "Unicode support" really means
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-72942@lists.php.net to get a copy of this message
I mean abstract this away in a string object with meta-data. If windows, some specific ICU functions or Foo need utf-16 then convert silently and optimize later (e.g. a flag for "has no multibyte code points").
Abstracting it away would cause problems, though. For one, the performance hit would be worse than it needs to be. For another, not all encodings support the same operations, e.g. you can’t seek backwards through a Shift-JIS string. You’d have to limit yourself to doing things that all encodings support.
Only an abstraction of string with meta data. Not all/whole conversion service(s) in one string class. We can't know what conversions someone will need. e.g.: apicall(toUtf32converter($string-with-meta));

« previous php.internals (#72942) next »