Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: XML::Simple and ISO-8859-1 encoding buggy?

by Anonymous Monk
on May 28, 2021 at 01:51 UTC ( #11133191=note: print w/replies, xml ) Need Help??


in reply to Re^2: XML::Simple and ISO-8859-1 encoding buggy?
in thread XML::Simple and ISO-8859-1 encoding buggy?

gzip/bzip2/deflate/compress/base64/quoted-printable are all encodings

decoded_content decodes these (and more)

XML::Simple doesn't decode those

https://metacpan.org/pod/HTTP::Message#$mess-%3Edecoded_content(-%options-) also has xml bits, which can be avoided with

shortcut https://metacpan.org/pod/HTTP::Message#$mess-%3Edecode

$LWP_Data->{feed}->decode; my $xml = $LWP_Data->{feed}->content;

Replies are listed 'Best First'.
Re^4: XML::Simple and ISO-8859-1 encoding buggy?
by ikegami (Pope) on May 29, 2021 at 02:31 UTC

    Transfer encodings (gzip, compress, etc) are already removed automatically. No need to use decoded_content for that.

    decoded_content does remove some content encodings. This means, for example, that it allows you to request a .gz file and get the .xml within. But the OP didn't say anything about requesting a non-XML file and wanting to get the XML from it.

    Finally, and most relevant, it also undoes character encodings, and that's bad. It can be told not to do this, but my comment was directed a code that didn't prevent this.

    Seeking work! You can reach me at ikegami@adaelis.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133191]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-08-03 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (39 votes). Check out past polls.

    Notices?