Subject: | bug-JSON |
Date: | Tue, 24 Sep 2013 17:06:14 -0500 |
To: | bug-JSON [...] rt.cpan.org |
From: | Jerry Sinclair <jerry.sinclair [...] pearson.com> |
bug-JSON
Perl Version: Perl v5.8.8 built for x86_64-linux-thread-multi
uname –a: Linux icduxadixapp01 2.6.18-348.6.1.el5 #1 SMP Fri Apr 26
09:21:26 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
Code is:
use strict;
use warnings;
use Data::Dumper;
use JSON -support_by_pp;
my %sdata;
$sdata{'text'} = "\'I said\', \"She said\"";
my $json_obj = encode_json \%sdata;
print ">>>" . Dumper(\$json_obj);
Output:
Show quoted text
>>>$VAR1 = \'{"text":"\'I said\', \\"She said\\""}';
There shouldn’t be the double \\ in front of the " … there should only be \"
.
Jerry