NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
well (Score:1)
rjbs
Re: (Score:2)
Sorry to tell you this ... (Score:2)
Nope, it doesn't. I believe that's because JSON is valid JavaScript syntax and there's no "natural" way to represent binary in a simple string format.
What do you really mean by 'binary data'? (Score:1)
and http://json.org/ [json.org] says "A string is a collection of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. [...]. A string is very much like a C or Java string."
Does that mean JSON "doesn't have native support for binary data"? Depends on your needs I guess (and whether you control the sending and/or receivin
Re: (Score:1)
png & (Score:1)
JSON::XS makes it easy (Score:2)
$ perl -MJSON::XS -MFile::Slurp -e '$g=read_file("add.gif"); print JSON::XS->new->ascii(1)->encode({file=>$g})' > json
$ perl -MJSON::XS -MFile::Slurp -e '$g=read_file("json"); $d = decode_json($g); print $d->{file}' > gif
$ diff add.gif gif
$
-- ask bjoern hansen [askbjoernhansen.com], !try; do();
Re: (Score:2)
Re: (Score:2)
-- ask bjoern hansen [askbjoernhansen.com], !try; do();