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. WWW: http://search.cpan.org/dist/IO-HTML/