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-- "}"
If it doesn't get removed by the newsgroup editors, there is a weird character at the very end of x. It looks almost like "[]" but it is
not. When you edit it, it acts as if it has multiple characters in it.
Another problem is that tdom man page talks about a command "dom setResultEncoding ?encodingName?" but trying it results in an unknown
command error.
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-- "}"
On 12/16/2024 9:13 PM, greg wrote:
Hello,
The unknown character is 007 or BELL.
Probably not allowed as a char in string.
Instead: \u0007
Gregor
Thank you and Rich for the wonderful info and the code.
The json data is what I receive from an api. I first thought it had
to do with encoding issues. It happens frequently so I maybe I will
ask them to be more careful with their json data generation.
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-- "}"
Another problem is that tdom man page talks about a command "dom setResultEncoding ?encodingName?" but trying it results in an unknown
command error.
Thanks for the info. I am using version 0.9.5 I downloaded from its
official site some time ago. It comes with no documentation so I did an internet search. I guess that piece of info is from an outdated web
page obviously, which I kind of guessed.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 463 |
Nodes: | 16 (2 / 14) |
Uptime: | 157:03:12 |
Calls: | 9,384 |
Calls today: | 4 |
Files: | 13,561 |
Messages: | 6,095,919 |