Perl: the Markov chain saw | |
PerlMonks |
Re^2: Chinese site and decoded_content() troubleby isync (Hermit) |
on Jun 11, 2007 at 08:50 UTC ( [id://620442]=note: print w/replies, xml ) | Need Help?? |
Thanks for your comment! And thank you for pointing out the raise_error switch - which I wasn't aware of (rtfm...)!
Running your test script gives me these errors: which points me at the problem that decoded_content uses the wrong charset for decoding. (right?) A search on the issue led me to this helpful thread http://www.issociate.de/board/post/400895/Fetching_the_charset_when_set_in_meta..html and the non-cpan module HTTP::Response::Charset (which I haven't tried so far). So I am stuck here with three options: 1. use Encode::Guess 2. use HTML::Encoding 3. use HTTP::Response::Charset A quick test seems to show that HTML::Encoding is the most reliable (and much less a hassle to install than Encode::Detect). Now I will try But how do I combine it elegantly with LWP? (I am not a great module guru..) Is there a way to pull it into the LWP context and get, let's say, $response->as_utf8 (which is the result of the above)?
In Section
Seekers of Perl Wisdom
|
|