[Bug 8425] Cloning a DOMString with unpaired surrogates should throw SYNTAX_ERR, to allow UAs to serialise structured clones as UTF-8.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=8425


Maciej Stachowiak <mjs@apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjs@apple.com




--- Comment #1 from Maciej Stachowiak <mjs@apple.com>  2010-01-05 04:06:20 ---
I disagree with this suggestion:

A) DOM Strings (and ECMAScript strings) are everywhere else treated as a
sequence of UTF-16 code units and do not fail on bad surrogate pairs.

B) "Strings" with possibly invalid surrogate pairs are useful as a workaround
to store binary data, in the absence of a proper class for doing so. Thus,
throwing an exception in this case would remove useful functionality.

C) It's pretty simple to do a almost-UTF-16 --> almost-UTF-8 converter that
round trips unpaired surrogates simply by encoding them as if they were
individual Unicode characters. Thus, the limitation is not actually required to
implement the described behavior.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 5 January 2010 04:06:23 UTC