Re: What "Unicode support" really means
| From: | Andrea Faulds | Date: | Wed, 05 Mar 2014 21:07:33 +0000 |
| Subject: | Re: What "Unicode support" really means | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72940@lists.php.net to get a copy of this message | ||
On 5 Mar 2014, at 21:02, Crypto Compress <cryptocompress@googlemail.com> wrote:
> Am 05.03.2014 21:48, schrieb Andrea Faulds:
>>
>> On 5 Mar 2014, at 20:46, Crypto Compress <cryptocompress@googlemail.com> wrote:
>>
>>>
>>>> Please, can we simply use Unicode as the “one true encoding”?
>>>
>>> Unicode has four: utf-8, utf-16le, utf-16be, utf-32...
>>
>>
>> I mean one character set (Unicode) and one encoding (UTF-8).
>
> 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.
--
Andrea Faulds
http://ajf.me/