Sujet : Re: tdom encoding
De : rolf (at) *nospam* pointsman.de (Rolf Ade)
Groupes : comp.lang.tclDate : 18. Dec 2024, 15:04:07
Autres entêtes
Organisation : Me
Message-ID : <87y10drstk.fsf@pointsman.de>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13)
saito <
saitology9@gmail.com> writes:
I am trying to see why tdom is failing on this json snippet.
>
package req tdom
set x {{"name":"Jeremi"}}
dom parse -json $x
>
==> error "JSON syntax error" at position 15
"{"name":"Jeremi <--Error-- "}"
Rich already pointed out rightly that control characters are not allowed
literally in JSON strings. As tDOM rightly complains your input is not
JSON.
[snip]
Another problem is that tdom man page talks about a command "dom
setResultEncoding ?encodingName?" but trying it results in an unknown
command error.
You obviously use a (very) old tDOM version. The dom method
setResultEncoding is a relict out of the times as tDOM still supported
Tcl 8.0 (and the functionality was only needed / useful if build/used
with Tcl 8.0).
The documentation and implementation of this method was removed with
tDOM 0.9.1 (more than six years ago). Most recent version is 0.9.5.
rolf