Escape forms
Encode turns newline/tab/CR/backslash/quote into \n \t \r \\ \" — other control chars use \xNN. Optionally non-ASCII uses \uXXXX (or \u{…} above BMP). Decode reverses all of these.
Frequently asked questions
JSON safe?
The escaped output drops straight into a JSON string.
Emoji?
Escaped as \u{1F600} when non-ASCII mode is on.
Partial decode?
Only real escape sequences change — \q stays literal.