Is there anyway to do this in JavaScript:
$ cat test.json
{"body":"\u0000"}
$ python3 -c 'import json; print(json.load(open("test.json", "r")))'
{'body': '\x00'}
Notice, the data above only one \
(does not need to be escaped). So you have the following situation in JavaScript:
JSON.parse('{"body":"\\u0000"}') // works
JSON.parse('{"body":"\u0000"}') // does not work
With potentially any UTF-8 data comming from a binary source (websocket), can this data be processed directly like in the first python example above?