JSON-PP
JSON-PP copied to clipboard
boolean encoding should recognize PL_sv_yes, PL_sv_no
This is inconsistent with Cpanel::JSON::XS's behaviour:
perl -MCpanel::JSON::XS -wle'print Cpanel::JSON::XS->new->allow_nonref(1)->encode(!0)'
true
perl -MJSON::PP -wle'print JSON::PP->new->allow_nonref(1)->encode(!0)'
1
There isn't really any reasonable way to do this in older perl versions, but it will work in perl 5.35.10+ with JSON::PP 4.08 and newer.