I see under HTTP::Response, the options to retrieve raw content or decoded content.

But there doesn't seem to be a $response->type, where type returns something to indicate whether I should "decode the content" (i.e. an HTML file), or should get the 'raw' content' (i.e. it's binary and decoding it would mess it up).

If I call content, then I get a raw, but HTML isn't decoded to UTF-8, but if I call decoded content, then it says: "Returns the content with any Content-Encoding undone and the raw content encoded to perl's Unicode strings."

By encoding a 'gif' file into UTF-8, it will corrupt the file. So this doesn't seem to help, but seems to be stuck at the same place I was before -- knowing the content of the the buffer before looking at it! *lame!*...

This seems so basic -- there has to be a way to properly retrieve a URI, and process it or store it, unprocessed -- I'm just missing it...since it seems like a very common problem, I can't imagine that everyone goes and starts hacking headers and trying to figure out what combination of 'use utf8/local/bytes'...etc, is necessary to make sense of this ...


In reply to Re^2: LWP::Curl and character encoding by perl-diddler
in thread LWP::Curl and character encoding by perl-diddler

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.