Just in case you need it, I implemented fastest found JS helper that counts UTF-8 codepoints in Buffer. https://gist.github.com/RReverser/f5cb2152d2655b9e9d09 … cc @mathias
@RReverser There is no such thing as “UTF-8 code points” btw. It’s either Unicode code points, or their UTF-8 encoded byte sequences.
-
-
@mathias So yeah, it should count byte sequences. Let me check your example in ~20 mins. -
@mathias You know, this is weird :/ new TextEncoder().encode('𝌆') returns 1 in the browser, but new Buffer('𝌆') returns 4 in Node. - 4 more replies
New conversation -
-
-
@mathias Okaay :/ Terminology is hard.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.