Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: HTML parsing module handles known and unknown encoding

by ikegami (Pope)
on Nov 17, 2011 at 09:04 UTC ( #938549=note: print w/ replies, xml ) Need Help??


in reply to Re^2: HTML parsing module handles known and unknown encoding
in thread HTML parsing module handles known and unknown encoding

However, in the real world, you'll often find that HTML documents are served over HTTP where the HTTP headers don't tell the encoding of the document.

You appear to have missed crucial information in my post. Like I said, $response->decoded_content() will decode the HTML for you, based on the HTTP header, BOM and META elements (if HTML).

In that case, you'll need a way to find the encoding from the document itself. A HTML parser should support both of these cases.

Sure, though I'm not familiar with an HTML parser that supports both.


Comment on Re^3: HTML parsing module handles known and unknown encoding
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938549]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2014-08-01 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (8 votes), past polls