A Stage 3 ECMAScript proposal changes JSON.stringify to prevent it from returning ill-formed Unicode strings. Previously, JSON.stringify would output lone surrogates if the input contained any lone surrogates: ``` JSON.stringify("\uD800"); // --> '"�"' ``` With this change, JSON.stringify outputs escape sequences for lone surrogates, making its output valid Unicode (and representable in UTF-8): ``` JSON.stringify("\uD800"); // --> '"\ud800"' ```



Editor's draft

Status in Chromium


Enabled by default (tracking bug) in:

  • Chrome for desktop release 72
  • Chrome for Android release 72
  • Android WebView release 72

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.


Last updated on 2020-11-09