On Mon, Feb 27, 2012 at 5:34 PM, Arun Ranganathan <[email protected]>wrote:
> Simon, > > Is the relevant part of HTML sufficient to refer to? > http://dev.w3.org/html5/spec/Overview.html#utf-8 > That defines decoding UTF-8 to Unicode strings. You need the reverse. Using a replacement scheme like UTF-8 decoding, instead of a hard exception, seems more consistent with how encodings in general are handled. Otherwise, you'll end up with bugs in code if, for example, people paste in unpaired surrogates (Firefox allows this, last I checked), causing unexpected exceptions in code. Instead, just convert them to U+FFFD, which gives much more graceful error handling for such a rare case that most people will never handle explicitly. I think WebSocket should do the same, for the same reason. -- Glenn Maynard
