http://www.perlmonks.org?node_id=721467


in reply to How to handle unicode txt file on Windows

Look at File::BOM.

/J