perl-IO-HTML -- Open an HTML file with automatic charset detection 

IO::HTML provides an easy way to open a file containing HTML while 
automatically determining its encoding. It uses the HTML5 encoding 
sniffing algorithm specified in section 8.2.2.1 of the draft 
standard.