Skip to content

topic: 200B is categorised as Zs in Unicode 3.0

Kotaro Endo edited this page Mar 24, 2015 · 2 revisions

According to the specification (in section 7.2):

ECMAScript implementations must recognise all of the white space characters
defined in Unicode 3.0.

And 'white space' here is defined in Table 2 which includes unicode category "Zs".

This topic focuses on the character U+200B. It is categorised as "Zs" in Unicode 3.0 but categorised as "Cf" in Unicode 4.0.1 or later. According to the specification, it must be recognised as a white space. (You can check Unicode definition visiting http://www.unicode.org/Public/)

Consider following expression:

eval("\u200Btrue")

This should be true instead of throwing a SyntaxError in which case the implementation seems to be solely based on the Unicode 4.0.1 or later.

You can check this by ES5specsim (To get right result, you must initialise the realm with STRICT CONFORMANCE flag turning on which switches to Unicode 3.0)

On the other hand, many browsers do not recognise U+200B as a white space.