Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Unicode With LWP

by Juerd (Abbot)
on Jan 20, 2008 at 00:36 UTC ( #663253=note: print w/replies, xml ) Need Help??

in reply to Unicode With LWP

LWP::Simple gives you the content as a byte string, ignoring the charset attribute in the Content-Type header. If you want to pass the data along without decoding it, you will have to use the same charset that your source used, but LWP::Simple didn't provide it.

You could find it out manually, hard code it, and hope they'll never change it. Or you could hop from LWP::Simple to a more advanced module, like full LWP. My favourite way of doing this is to use decoded_content and then explicitly re-encode as UTF-8 for output, because I like to standardize on UTF-8 for web stuff.

Juerd # { site => '', do_not_use => 'spamtrap', perl6_server => 'feather' }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://663253]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-03-24 14:27 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.