cnpait / detect_encoding
Cyrillic text encoding detection class
Installs: 31 675
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 13
pkg:composer/cnpait/detect_encoding
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-11-11 02:51:27 UTC
README
Detect utf-8, windows-1251, koi8-r, iso8859-5 cyrillic encoding
Installation with Composer
Declare detect_encoding as a dependency in your projects composer.json file:
{
"require": {
"ivanmtw/detect_encoding": "dev-master"
}
}
Usage Example
<?php use DetectCyrillic\Encoding; $text = 'Привет, как дела?'; //require_once 'detect_encoding/classes/DetectCyrillic/Encoding.php'; $Detector = new Encoding(); $encoding = $Detector->detectMaxRelevant($text); ?>
Requirements
PHP 5.3 and up.
Класс для определения кодировки текста. Использует статистические методы, см. исходные статьи:
Код является оберткой, готовой к эксплуатации, на основе https://github.com/m00t/detect_encoding/