Closed
Description
The algorithm to serialize a string has a separate clause for NULL character which says:
If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD) escaped as code point.
However, this doesn't match behavior of any browser.
Firefox and Chrome serialize NULL character to U+FFFD without escaping it as code point. Edge strips anything after NULL, and Safari serializes it as the character escaped as code point (so \0
).
I guess the spec means to do what Firefox and Chrome are currently doing, so probably we should fix the spec text?