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

For the original use case here, I think it would still be preferable to get the Gecko and Chromium keyboard event bugs fixed instead of adding facilities for optimizing workarounds. It would be good to do so before EdgeHTML fades away, as it now keeps the Web from assuming the Gecko/Chromium bug.

`String.isWellFormed()` makes sense if there are enough use cases where the action taken in the ill-formed case is something other than making the string well-formed. If the action is making the string well-formed, it would make more sense to have a method that does that: `String.makeWellFormed()` that returns `this` if well-formed and a new `String` with lone surrogates replaced with the REPLACEMENT CHARACTER otherwise.

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

Received on Wednesday, 6 May 2020 12:44:43 UTC