Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

comment on

( #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)


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

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2023-09-30 00:21 GMT
Find Nodes?
    Voting Booth?

    No recent polls found