I'm using WWW::Mechanize (v1.54) to log into a site and extract some data from there. At some pages, I'm getting the "Wide character in print" warning message when saving using $mech->save_content().
I noticed that those pages have explicit charset defined twice and do not match:
Content-type: text/html;charset=ISO-8859-1
in the HTTP response header, and
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
inside the html page.
Doing a trace, $mech->content_type() returns "text/html" and $mech->response()->encoding() returns "iso-8859-1".
It seems that WWW::Mechanize has to check not only the content type for the binmode but also the encoding in save_content() method (and probably more methods), or maybe HTTP::Response is not doing it's work?
Or am I missing something?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.