Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6 astral-plane unicode support #30

Open
webbedspace opened this issue May 3, 2015 · 0 comments
Open

ES6 astral-plane unicode support #30

webbedspace opened this issue May 3, 2015 · 0 comments

Comments

@webbedspace
Copy link

"Astral plane" characters (those whose code point value >= 0x10000) are supported in ES6 in the following ways:

  • Iteration over strings correctly produces the code point - console.log(...'a😬c') logs "a" "😬" "c", whereas var str = 'a😬c'; for (var i = 0; i < str.length; i++) { console.log(str[i]) } logs "a" "�" "�" "c".
  • In that vein, [...'a😬c'].length is the correct value of 3, rather than 'a😬c'.length's incorrect value of 4.
  • String.codePointAt() lets you receive the correct code point - 'a😬c'.codePointAt(1) is '😬', but 'a😬c'[1] is '�'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant