Question about the “full Unicode in strings” strawman

Mathias Bynens mathias at qiwi.be
Sun Jan 22 22:59:31 PST 2012


http://wiki.ecmascript.org/doku.php?id=strawman:support_full_unicode_in_strings#unicode_escape_sequences
states:

> To address this issue, a new form ofUnicodeEscapeSequence is added that is explicitly tagged as containing var variable number (up to 8) of hex digits. The new definition is:
>
> UnicodeEscapeSequence ::
> u HexDigit HexDigit HexDigit HexDigit
> u{ HexDigit HexDigitopt HexDigitopt HexDigitopt HexDigitopt HexDigitopt HexDigitopt HexDigitopt }
>
> The \u{ } extended UnicodeEscapeSequence is a syntactic extension that is only recognized after explicit versioning opt-in to the extended “Harmony” syntax.

Why up to 8 hex digits? Shouldn’t 6 hex digits suffice to represent
every possible Unicode character (in the range from 0x0 to 0x10ffff)?

Is this a typo or was this done intentionally to be future-compatible
with potential Unicode additions?


More information about the es-discuss mailing list