| Summary: | perl-JSON-PP: produces invalid JSON | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Florian Weimer <fweimer> |
| Component: | perl-JSON-PP | Assignee: | perl-maint-list |
| Status: | CLOSED NOTABUG | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.0 | CC: | ppisar |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-10-29 15:01:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 1024293 | ||
|
Description
Florian Weimer
2013-10-29 11:12:23 UTC
The solidus escaping an apostrophe is result of Data::Dumper::Dumper(). The JSON::PP::encode_json() does not do that. See simpler case:
$ perl -MJSON::PP -e "print encode_json([qq{'}]), qq{\n}"
["'"]
Ugh, sorry about that. You are right, of course. This part of the source code confused me:
my %esc = (
"\n" => '\n',
"\r" => '\r',
"\t" => '\t',
"\f" => '\f',
"\b" => '\b',
"\"" => '\"',
"\\" => '\\\\',
"\'" => '\\\'',
);
$arg =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/g;
' is present in the hash, but not in the regular expression.
|