Tk Library Source Code

View Ticket
Login
Ticket UUID: 3610478
Title: json conversion fails on help example
Type: Bug Version: None
Submitter: tombert Created on: 2013-04-10 16:24:49
Subsystem: json Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Deleted Last Modified: 2013-04-10 23:34:51
Resolution: None Closed By: tombert
    Closed on: 2013-04-10 16:34:51
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
User Comments: tombert added on 2013-04-10 23:34:51:

allow_comments - 1

trying to simplify the examples ...