<?xml version="1.0" encoding="windows-1252"?>
<node id="542602" title="Answer: How do I determine encoding format of a file ?" created="2006-04-11 12:37:58" updated="2006-04-11 08:37:58">
<type id="1888">
categorized answer</type>
<author id="11732">
QandAEditors</author>
<data>
<field name="doctext">
&lt;p&gt;[mod://File::BOM] provides &lt;c&gt;get_encoding_from_filehandle&lt;/c&gt; and &lt;c&gt;get_encoding from_stream&lt;/c&gt; to identify the encoding of Unicode files.  Example:&lt;/p&gt;
&lt;code&gt;
use File::BOM qw( :all );
open $fh, '&lt;', $filename;
my ($encoding) = get_encoding_from_filehandle($fh);
&lt;/code&gt;
</field>
<field name="parent_node">
256728</field>
</data>
</node>
