Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Greetings Wise Monks

Over the years I have created and maintained a crawler for a customer. As of late a few sites that they crawl various Parser modules (pullparser/tokeparser) have been getting noisy. (warnings) with this noise "Parsing of undecoded UTF-8 will give garbage when decoding entities"

I have done all the searches and tried all the solutions that I have found from simply using utf8_mode(1) to encoding/decoding the page before I pass it to the parser to no avail.

I have saved the pages to disk to examine them and they seem fine. We are using curl::multi to get the pages, and all is well for all but a couple sites. These sites are using a CDN as they are quite large, though, this is the norm for a number of their clients and we don't have the same warnings

I'm not even sure how to ask how to fix what I don't know is broken. I suppose the right question is what can someone suggest to help me track down the WHY it's being noisy, when the pages seem to be utf8 encoded properly. The utf8 flag is on ie.

my $pagetoparse = HTML::TokeParser->new(doc => \$pagein); $pagetoparse->utf8_mode(1);

$page in is the raw html document, it appears in all testing to be properly encoded and not mixed etc etc.

Is it something simple that I have overlooked or misunderstood, and why is it not on every page? it's generated by a cms, but it barks only so many x pages....

Thank you in advance for any wisdom that is rendered. I've run out of ideas.

I have looked here, tried everything, searched on google, tried every possible solution I could understand to try (must be one that I have missed, or not understood)

Scott


In reply to Parsing of undecoded UTF-8 will give garbage when decoding entities by itsscott

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found