my $charset = detect($octets);
my $d = new Encode::Detect::Detector;
my $charset = $d->getresult;
DESCRIPTIONThis module provides an interface to Mozilla's universal charset detector, which detects the charset used to encode data.
$charset = Encode::Detect::Detector->detect($octets)Detect the charset used to encode the data in $octets and return the charset's name. Returns undef if the charset cannot be determined with sufficient confidence.
$d = Encode::Detect::Detector->new()Creates a new "Encode::Detect::Detector" object and returns it.
$d->handle($octets)Provides an additional chunk of data to be examined by the detector. May be called multiple times.
Returns zero on success, nonzero if a memory allocation failed.
$d->eofInforms the detector that there is no more data to be examined. In many cases, this is necessary in order for the detector to make a decision on the charset.
$d->resetResets the detector to its initial state.
$d->getresultReturns the name of the detected charset or "undef" if no charset has (yet) been decided upon. May be called at any time.
AUTHORJohn Gardiner Myers <[email protected]>
SUPPORTFor help and thank you notes, e-mail the author directly. To report a bug, submit a patch, or add to the wishlist please visit the CPAN bug manager at: http://rt.cpan.org