inok / detect-cyr-encoding
Detect Text Cyrillic Encoding
1.0.0
2023-05-15 10:01 UTC
Requires
- php: >=7.0 || ~8.0.0
- ext-mbstring: *
This package is auto-updated.
Last update: 2024-12-15 14:48:56 UTC
README
This package for detecting cyrillic encoding of source text (Supports encodings: 'UTF-8', 'cp866', 'cp1251')
Installation
You can install this package by using Composer, running this command:
composer require inok/detect-cyr-encoding
Link to Packagist: https://packagist.org/packages/inok/detect-cyr-encoding
Usage
$detector = new \Inok\detectCyrEncoding\Detector(); $encoding = $detector->detect($text);
where:
- $text - Text for detect encoding
return:
- $encoding - string with one of detected encodings: UTF-8, cp866, cp1251
License
This package is released under the MIT license.
Copyright (c) 2023 Chizhov Nikolay