asciiOnly == false, returns s.string escapeJSONString(const string s, const char quote = '"', const bool asciiOnly = false) @safeEscape a UTF-8 string for inclusion in a JSON/JSON5 string literal.
This function returns the escaped string without surrounding quotes.
s | Input UTF-8 string. |
quote | Quote character that must be escaped (`'"'` or `'\''`). |
asciiOnly | When true, escape non-ASCII code points using \uXXXX or surrogate pairs. |
asciiOnly == false, returns s.