Escape a string as JSON, or as \u escapes. The other side updates as you type.
1
1
A string escape writes a character that would otherwise end the literal or that is hard to see. JSON uses a backslash, as specified in RFC 8259. A quote becomes \", a newline becomes \n, and a non-ASCII character may become \u00e9.
JSON mode wraps the text in quotes with JSON.stringify, and reads a quoted JSON string back. Unicode mode leaves ASCII printable characters alone, escapes the rest as \uXXXX, and uses \u{...} for a code point above U+FFFF.
say "hi"
"say \"hi\""
café
caf\u00e9
hello
"hello"
Unicode mode does not treat \n as a newline. Only \\ , \uXXXX, and \u{...} are escapes. JSON mode follows the full JSON string rules, including \n, \t, and \/.
JSON.stringify writes an emoji as a UTF-16 surrogate pair, two \u escapes. Unicode mode writes one \u{...} escape. Both decode to the same character in their own mode.
\uXXXX is one UTF-16 code unit. A value from U+D800 to U+DFFF is a surrogate. Unicode mode accepts it so a pair can be decoded one unit at a time.
The share link stores the source side, its text, and the mode. The other side is computed again. Anyone who has the link can read that text.
RFC 8259, published in December 2017, requires JSON to be transmitted as Unicode and says a string may escape any character. It does not define \u{...}: that brace form is from JavaScript, added for code points in ECMAScript 6.
JSON allows \/ for a slash. JSON.stringify does not emit it. A string that was escaped with \/ still parses.