Hello monks.

Today I uploaded my perl program to my server. My local perl is 5.12.2 and server'perl is 5.8.8. And I met strange problem. LWP::Simple'get() function gives me decoded utf8 characters with my 5.12.2 local machine. But 5.8.8 machine gives me not decoded utf8 bytes. Each version of LWP::Simple is 5.835(local) and 5.810(server).

In get() function, LWP::Simple calls HTTP::Response's "decoded_content" method. Document of CPAN says

"This will return the content after any Content-Encoding and charsets have been decoded."

I guess there was some change for HTTP::Response's decoded _content. Does anyone met the same situation? Maybe,

$html=utf8::is_utf8($html) ? $html : decode('utf8', $html);
will solve my problem, but I would like to hear from monk's opinion.

regards.( I am sorry for my poor english)

In reply to LWP::Simple is it get decoded or not ? by remiah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.