Skip to content

ivanmtw/detect_encoding

 
 

Repository files navigation

Cyrillic text encoding detection class

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/

About

Cyrillic text encoding detection class for php >=5.3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%