W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [FileAPI, common] UTF-16 to UTF-8 conversion

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 28 Feb 2012 01:11:10 +0100
To: "Eric U" <ericu@google.com>, "Simon Pieters" <simonp@opera.com>, "Arun Ranganathan" <aranganathan@mozilla.com>
Cc: public-webapps@w3.org, "Glenn Maynard" <glenn@zewt.org>, "Jonas Sicking" <jonas@sicking.cc>
Message-ID: <op.wac34wts64w2qv@annevk-macbookpro.local>
On Tue, 28 Feb 2012 00:34:57 +0100, Arun Ranganathan  
<aranganathan@mozilla.com> wrote:
> Is the relevant part of HTML sufficient to refer to?   
> http://dev.w3.org/html5/spec/Overview.html#utf-8

That is UTF-8 octets -> Unicode code points. UTF-16 -> UTF-8 is different.  
You want the algorithm in Web IDL that takes a DOMString and gives you  
Unicode. And then from Unicode you go to UTF-8. If you want it to never  
fail that is and not generate "broken" UTF-8.

Anne van Kesteren
Received on Tuesday, 28 February 2012 00:12:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:31 UTC