Sujet : Re: tdom encoding
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tclDate : 17. Dec 2024, 05:20:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vjqu76$1i1a9$1@dont-email.me>
References : 1
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
saito <
saitology9@gmail.com> wrote:
I am trying to see why tdom is failing on this json snippet.
package req tdom
set x {{"name":"Jeremi^G"}}
dom parse -json $x
==> error "JSON syntax error" at position 15
"{"name":"Jeremi^G <--Error-- "}"
Assuming the ^G that did come through properly represnts the
character, then greg is right, it is an ASCII bell character, and per
the JSON spec [1] raw control characters are not allowed to be part of
a JSON string.
Which is why Tdom is telling you 'error' at the ^G output.
Are you on linux? If yes the hexdump, objdump, or xxd (xxd is easiest
to use) commands will show you exactly what raw byte values exist in
the file.
[1]
https://www.json.org/json-en.html