- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Mon, 22 May 2023 20:38:09 +0000
- To: public-css-archive@w3.org
Those are not codepoints that you're looking at. ```js "💅".codePointAt(0).toString(16) // '1f485' ``` The Syntax spec runs on a stream of code *points*, but JS naively returns code *units*, which are limited to the range 0-ffff. To encode any higher code points JS splits them into two code units using the reserved surrogate range, from d800-dfff. You have to account for this when parsing strings from JS. ([My parser](https://github.com/tabatkins/parse-css/blob/main/parse-css.js#L38) just eagerly converts the whole string into an array of codepoints, but these days you can do that more easily with an `Array.from(str, cp=>cp.codePointAt(0))` call, since the iterator protocol on strings advances by codepoint.) -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8862#issuecomment-1557953245 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 22 May 2023 20:38:11 UTC