api-skeletons/correct-utf8-encoding
Composer 安装命令:
composer require api-skeletons/correct-utf8-encoding
包简介
Correct badly encoded and multiple encoded UTF8 characters by examining each byte in a string.
README 文档
README
When utf-8 data is mishandled it can become multiple encoded. Data with invalid utf-8 sequences cannot be properly imported to databases and renders incorrectly in a correctly encoded web page.
The class provided by this module examines a string byte-by-byte. It does not use predefined sequences to match against data. Instead it walks through the string looking for possible utf8 data and looping on the data until it produces a valid utf-8 character.
Use
use ApiSkeletons\Utf8; $correctUtf8Encoding = new Utf8\CorrectUtf8Encoding(); $validString = $correctUtf8Encoding($invalidString);
Comment
This library is unlike the other UTF8 correction tools available on packagist at the time of this writing. Whether this tool is better than other offerings is based soley on your success with the tool. For my needs this tool corrected a 20 year old dataset for the entire database field-by-field and byte-by-byte.
Please don't hesitate to contact contact@apiskeletons.com with any stories of success or failure with this tool.
Correct Entire Database
There is a companion application which uses this library to correct every invalid utf8 character in an entire database. Please see https://github.com/API-Skeletons/utf8convert
api-skeletons/correct-utf8-encoding 适用场景与选型建议
api-skeletons/correct-utf8-encoding 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 01 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 api-skeletons/correct-utf8-encoding 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 api-skeletons/correct-utf8-encoding 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-19