NAME

Encode::Detective - detect a data encoding

SYNOPSIS

use Encode;
require Encode::Detective 'detect';
my $encoding = detect ($data);
# Now $encoding contains a guess of the encoding of $data.

DESCRIPTION

This module guesses the character set of input data. It is similar to Encode::Guess, but does not require a list of expected encodings.

FUNCTIONS

detect

my $encoding = detect ($data);

Given a set of bytes, $data, this looks at the bytes, and guesses what encoding they are encoded in using probabilities.

HISTORY

This module is based on code of Firefox. When this module was created, the C++ code for character set detection was available as a standalone library. Now the code cannot be used as a standalone library, so this has become a fork of the original Mozilla code.

Encode::Detective is a fork of Encode::Detect. It removes almost all of the interface of Encode::Detect except the single function "detect".

AUTHORS

Encode::Detective is based on Encode::Detect by John Gardiner Myers <jgmyers@proofpoint.com>. It was forked by Ben Bullock <bkb@cpan.org>.

LICENCE

This Perl module may be used, copied, modified and redistributed under the terms of the Mozilla Public License version 1.1, the GNU General Public License, or the LGPL.