4 ms·
You can put control characters in JSON strings, you just need to escape them.
by gkbrk 3y ago
You can put control characters in JSON strings, you just need to escape them.
- pavon 3y agoThe way I read the json standard, the only way to include control characters is to encode them as hex. For example BEL can be encoded as "\u0007", but escaping it by using a backslash followed by a literal BEL character is not allowed. So literal control characters should never be in json text.
- lsaferite 3y agoThis makes me wonder if the Escape control character (\u001B) would work in a JSON string. Time to go test things out. :)