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

> There's still plenty of places strings with lone surrogates can come from (as mentioned above).

Are there? We've only encountered them with `<input>`. Could you give some concrete examples and explanation of how unpaired surrogates can occur? (Your examples above seemed pretty vague to me)

To be clear, unpaired surrogates are invalid UTF-16, and so anything that generates them is (in my opinion) a bug.

If you want to deal with binary data, you should be using something else like `Uint8Array`, not invalid JS strings.

-- 
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-480823618

Received on Monday, 8 April 2019 13:06:50 UTC