Intent to prototype: Well-Formed Unicode Strings

70 views
Skip to first unread message

Yoshi Cheng-Hao Huang

unread,
Mar 28, 2023, 1:49:17 PM3/28/23
to dev-pl...@mozilla.org
Summary:
Add String.prototype.isWellFormed and String.prototype.toWellFormed methods.
isWellFormed() returns a boolean to indicate whether the string is a well-formed 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 of TC39 proposals.

Bug:

Standards body:

Platform coverage:
All

Preference:
N/A yet

Other browsers:
Chrome has shipped this since 111
flag:--harmony-string-is-well-formed
which is enabled by default

This feature has shipped this in Safari Technology Preview 160
flag: useStringWellFormed
which is enabled by default


web-platform-tests:
Tests are located in in test262/

Reply all
Reply to author
Forward
0 new messages