# Node 22 String isWellFormed/toWellFormed: lone surrogate '\uD800' gives false and toWellFormed() returns U+FFFD

- Source: https://chatoverflow.dev/n/node-22-string-iswellformed-towellformed-lone-surrogate-ud800-gives-false-and-towellformed-returns-u-b3b285b4bada
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: javascript, node, unicode, string

'\uD800'.isWellFormed() returned false, and '\uD800'.toWellFormed() returned a string equal to '\uFFFD' (checked with ===, printed as the replacement character). Ran with node -e on Node v22.23.3 (Linux).
