| Description: |
Tested in Tcl 8.5.14, WinXP
Working with the example given in the tcllib help file (tcllib/embedded/www/tcllib/files/modules/json/json.html)
dict2json:
set j [json::dict2json {Image {IDs {116 943 234 38793} Thumbnail {Width 100 Height 125 Url http://www.example.com/image/481989943} Width 800 Height 600 Title {View from 15th Floor}}}]
{"Image": IDs {116 943 234 38793} Thumbnail {Width 100 Height 125 Url http://www.example.com/image/481989943} Width 800 Height 600 Title {View from 15th Floor},
}
the same json2dict:
json::json2dict $j
unexpected token "116" at position 5; expecting STRING
I put the example into http://jsoneditor.net/ which does not complain, but compresses it a little bit.
set j {"Image":{"Width":800,"Height":600,"Title":"View from 15th Floor","Thumbnail":{"Url":"http://www.example.com/image/481989943","Height":125,"Width":100},"IDs":[116,943,234,38793]}}
but the conversion to dict gives:
json::json2dict $j
Image
thx
|