NAME

EBook::Ishmael::CharDet - Guess the character encoding of given text

SYNOPSIS

use EBook::Ishmael::CharDet;

use Encode qw(encode);

# $encoding should be 'CP1250'
my $encoding = chardet(encode('CP1250', 'Obecná veřejná'));

DESCRIPTION

EBook::Ishmael::CharDet is a module that provides the chardet() subroutine which guesses character encoding of given text. This is a private module, please consult the ishmael manual for user documentation.

SUBROUTINES

$encoding = chardet($text)

Guesses the encoding for the encoded text $text through a series of heuristics. If chardet() cannot come to a conclusion, undef is returned.

The follow encodings are supported so far:

ASCII
UTF-8
UTF-16BE
UTF-16LE
UTF-32BE
UTF-32LE
GB2312
CP1250
CP1251
CP1252
CP1253
CP1254
CP1255
CP1256
HZ
ISO-2022-JP
ISO-2022-KR
ISO-8859-5
EUC-JP
EUC-KR
Big5
Shift_JIS

AUTHOR

Written by Samuel Young, <samyoung12788@gmail.com>.

This project's source can be found on its Codeberg Page. Comments and pull requests are welcome!

COPYRIGHT

Copyright (C) 2025-2026 Samuel Young

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.