legacy_mbstring/mb_detect_encoding
Composer 安装命令:
pie install legacy_mbstring/mb_detect_encoding
包简介
Old behavior of mbstring(mb_detect_encoding) (PHP 8.0)
README 文档
README
PHP 8.0 fallback mbstring functions. However, I hope without using this...
Why legacy_mbstring?
mb_detect_encoding is not have backward compatible since PHP 8.1. I'm not have interesting this function's changes behavior, but many PHP users are seems confused.
examples:
- mb_detect_encoding() results for UTF-7 differ between PHP 8.0 and 8.1 (if UTF-7 is present in the encodings list and the string contains '+' character) #10192
- mb_detect_encoding() detects UTF-8 emoji byte sequence as ISO-8859-1 since PHP 8.1 #7871
mbstring should to moving forward. However, some PHP users left behind old behavior. This fact is created that motivate it.
Instllation
I recommend using phpize.
$ git clone https://github.com/youkidearitai/legacy_mbstring
$ cd legacy_mbstring
$ phpize
$ ./configure
$ make
$ make install
Functions
legacy_mb_detect_encoding
Old behavior (<= PHP 8.0) mb_detect_encoding
legacy_mb_detect_encoding(string $string, array|string|null $encodings = null, bool $strict = false): string|false
legacy_mbstring/mb_detect_encoding 适用场景与选型建议
legacy_mbstring/mb_detect_encoding 是一款 基于 C 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 legacy_mbstring/mb_detect_encoding 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 legacy_mbstring/mb_detect_encoding 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 40
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-2.1-only
- 更新时间: 2026-04-08