This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 8425 - Cloning a DOMString with unpaired surrogates should throw SYNTAX_ERR, to allow UAs to serialise structured clones as UTF-8.
Summary: Cloning a DOMString with unpaired surrogates should throw SYNTAX_ERR, to allo...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: LC
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 01:03 UTC by contributor
Modified: 2010-10-04 13:59 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2009-12-03 01:03:50 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#structured-clone

Comment:
Cloning a DOMString with unpaired surrogates should throw SYNTAX_ERR, to allow UAs to serialise structured clones as UTF-8.

Posted from: 98.248.33.53
Comment 1 Maciej Stachowiak 2010-01-05 04:06:20 UTC
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.
Comment 2 Ian 'Hixie' Hickson 2010-01-07 11:41:21 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: Concurred with comment 1.