laziness, impatience, and hubris | |
PerlMonks |
Re: Converting entities in JSON contextby choroba (Cardinal) |
on May 19, 2022 at 12:48 UTC ( [id://11144002]=note: print w/replies, xml ) | Need Help?? |
You can fix the output by enabling the correct IO layer for the output:
Perl JSON modules keep the strings in parsed structures as characters, but when serializing to JSON strings, they use bytes and UTF-8 encoding. Update: According to the specification, JSON doesn't use entities, but it can use the \uXXXX notation, so instead of using HTML::Entities, you can try
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|