inok / detect-cyr-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-09-15 14:23:46 UTC
README
此包用于检测源文本的西里尔编码(支持的编码:'UTF-8', 'cp866', 'cp1251')
安装
您可以使用 Composer 安装此包,运行以下命令
composer require inok/detect-cyr-encoding
Packagist 链接: https://packagist.org.cn/packages/inok/detect-cyr-encoding
使用方法
$detector = new \Inok\detectCyrEncoding\Detector(); $encoding = $detector->detect($text);
其中
- $text - 要检测编码的文本
返回
- $encoding - 包含检测到的编码之一的字符串:UTF-8, cp866, cp1251
许可
此包根据 MIT 许可证 发布。
版权 (c) 2023 Chizhov Nikolay