logoalt Hacker News

conartist6yesterday at 5:59 PM1 replyview on HN

How would you then deal with a stream of UTF8 code points? They won't fit in a UInt8Array. There will be too many for async iterators to perform well: you'll hit the promise thrashing issues discussed in the blog post


Replies

Joker_vDyesterday at 6:06 PM

No, you'll just need to (potentially) keep the last 1-2 bytes of the previous chunk after each iteration. Come on, restartable UTF-8 APIs has been around for more than 30 years.

show 1 reply