Re: tdom encoding

Liste des GroupesRevenir à cl tcl 
Sujet : Re: tdom encoding
De : rolf (at) *nospam* pointsman.de (Rolf Ade)
Groupes : comp.lang.tcl
Date : 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

Date Sujet#  Auteur
17 Dec 24 * tdom encoding10saito
17 Dec 24 +* Re: tdom encoding4greg
17 Dec 24 i+* Re: tdom encoding2saito
17 Dec 24 ii`- Re: tdom encoding1Rich
19 Dec 24 i`- Re: tdom encoding1Alan Grunwald
17 Dec 24 +- Re: tdom encoding1Rich
18 Dec 24 `* Re: tdom encoding4Rolf Ade
18 Dec 24  `* Re: tdom encoding3saito
18 Dec 24   `* Re: tdom encoding2Harald Oehlmann
18 Dec 24    `- Re: tdom encoding1saito

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal