*Summary:* Add String.prototype.isWellFormed and String.prototype.toWellFormed methods. isWellFormed() returns a boolean to indicate whether the string is a well-formed <http://www.unicode.org/glossary/#well_formed_code_unit_sequence> UTF-16. toWellFormed() will return a string with the all unpaired surrogate code points converted to U+FFFD (REPLACEMENT CHARACTER)
This is currently at stage 3 <https://github.com/tc39/proposal-is-usv-string/blob/2022cc1f0b7941f6b02b4c65a9c26281c54d8aa6/README.md?plain=1#L5> of TC39 proposals. *Bug:* https://bugzilla.mozilla.org/show_bug.cgi?id=1803523 *Standards body:* https://tc39.es/proposal-is-usv-string/ *Platform coverage:* All *Preference:* N/A yet *Other browsers:* Chrome has shipped this since 111 https://chromestatus.com/feature/5200195346759680 flag:--harmony-string-is-well-formed which is enabled by default Safari: https://bugs.webkit.org/show_bug.cgi?id=248588 This feature has shipped this in Safari Technology Preview 160 https://webkit.org/blog/13639/release-notes-for-safari-technology-preview-160/ flag: useStringWellFormed which is enabled by default *web-platform-tests:* Tests are located in in test262/ https://github.com/tc39/test262/tree/main/test/built-ins/String/prototype/toWellFormed https://github.com/tc39/test262/tree/main/test/built-ins/String/prototype/isWellFormed -- You received this message because you are subscribed to the Google Groups "dev-platform@mozilla.org" group. To unsubscribe from this group and stop receiving emails from it, send an email to dev-platform+unsubscr...@mozilla.org. To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CAJ5FAhXszf-jSXiF7V%2B4WP9yQ2zMDkGNPxh_sjMXeOpvKwEv7w%40mail.gmail.com.