Re: [whatwg/encoding] Consider adding TextEncoder.containsLoneSurrogates() static (#174)

Firefox has SIMD-accelerated code for checking if a UTF-16 string is valid UTF-16. I guess it makes sense to expose it to the Web. It's less clear that `TextEncoder` is the right entry point as opposed to JS strings themselves. I can see how it would be more expedient to standardize a method at the WHATWG than at TC39, but it seems to me it ideally should be a JS string method.

Firefox currently doesn't have a mechanism to signal errors for unpaired surrogates in UTF-16 to UTF-8 conversion, because previously there has not been a use case for such detection. So implementing that approach would involve writing some new (non-glue) code.

I'd like to see if the [event issue](https://github.com/w3c/uievents/issues/227) can be fixed quickly in browsers.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/174#issuecomment-479029530

Received on Tuesday, 2 April 2019 14:42:54 UTC