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

> in what scenarios did you encounter issues? It would help to have specific examples.

@annevk Sorry I missed this!

I can't point to a specific issue because, as I said, until recently I haven't even realised I have one :) But these days I'm working on a mixed JS + WASM parser where JS API can be send strings to WASM and get ASTs with parsed strings backand the opposite direction for the codegen.

This is just one particular usecase, but both in this case and in any other that involves binary formats, native code or WASM, it feels better to have explicit detection and reporting of any errors instead of silently changing them to something else.

As mentioned above, this feels very similar to `TextDecoder` + `fatal` both in terms of usecases and desired behaviour.

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

Received on Thursday, 4 April 2019 22:13:42 UTC