thesoftwarefanatics / php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.
MIT License
35 stars 11 forks source link

[Proposal] Detect html5 <meta charset=""> #10

Open blaaat opened 6 years ago

blaaat commented 6 years ago

Currently only the http-equiv meta tag is used to find the charset used. I propose to include the html5 charset as well.

shusaura85 commented 6 years ago

I added the meta charset detection. I'm not sure it's the best method but was the fastest. I've attached the modified detectCharset() function from Dom.php here. I added the detection for the meta charset as primary check and enclosed the original http-equiv check in the else branch

Dom.txt