featherbb/php-utf-8
Composer 安装命令:
composer require featherbb/php-utf-8
包简介
A library for UTF-8 in PHP providing UTF-8 aware functions to mirror PHP's own string functions. The library doesn't require PHP mbstring extension although, if found, it will use it to gain performance.
README 文档
README
PHP-UTF-8
This is fork of the FSX/php-utf8 library. It was created because the author of origin library doesn`t support it.
php-utf8 is a UTF-8 aware library of functions mirroring PHP's own string functions. Does not require PHP mbstring extension though will use it, if found, for a (small) performance gain.
The project was initially on sourceforge where it died due to lack of development and support. This project has been forked and moved to github.com so that many more people can actually contribute with more ease.
Use the issue tracker here on github.com, to post about problems and feature requests.
Please feel free to fork and get back to us with fork requests for optimizations and new features.
Documentation & Usage Information
Using the php-utf-8 library is quite easy. Just include the php-utf8.php and
any additional functions that you may need from the functions folder.
Sample Code:
// get the core functions included ... require('php-utf8_path/php-utf8.php'); // ... and any other functions/*.php or utils/*.php files you may need. require('php-utf8_path/functions/trim.php');
Make sure that you are confident about using the library by reading Character Sets / Character Encoding Issues and Handling UTF-8 with PHP.
Use these functions only if you really need them & you understand why you need to use them.
In particular, do not blindly replace all use of PHP's string functions which functions found here. Most of the time you will not need to, and you will be introducing a significant performance overhead to your application.
Most of the functions here are not operating defensively, mainly for performance
reasons. For example there is no extensive parameter checking and it is assumed
that they are fed with well formed UTF-8. This is particularly relevant when is
comes to catching badly formed UTF-8. You should screen input on the outer perimeter
with help from functions in the utils/validation.php and utils/bad.php files.
Throughout the library all ASCII characters (control characters included) are treated as valid throughout the library. Make sure you take the appropriate measures before outputting into XML since it can become ill-formed with some control characters. more info
Licensing
The initial code of php-utf-8 is published under LGPL. Please find a copy of the license in the LICENSE file.
Parts of the code in this library come from other places, under different licenses. The authors involved have been contacted (see below). Attribution for which code came from elsewhere can be found in the source code itself.
- Andreas Gohr / Chris Smith of Dokuwiki. There is a fair degree of collaboration/exchange of ideas and code between Dokuwiki's UTF-8 library and phputf8. Although Dokuwiki is released under GPL, its UTF-8 library is released under LGPL, hence no conflict with phputf8
- Henri Sivonen (site) has also given permission for his code to be released under the terms of the LGPL. He ported a Unicode / UTF-8 converter from the Mozilla codebase to PHP, which is re-used in php-utf-8.
featherbb/php-utf-8 适用场景与选型建议
featherbb/php-utf-8 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 130 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「i18n」 「utf8」 「utf-8」 「unicode」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 featherbb/php-utf-8 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 featherbb/php-utf-8 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 featherbb/php-utf-8 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy to use i18n translation PHP class for multi-language websites
A custom URL rule class for Yii 2 which allows to create translated URL rules
tfpdf
utf8 util
Removes invalid UTF-8 characters from the given text
Country Flag Emoji for PHP
统计信息
- 总下载量: 130
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: LGPL-2.1
- 更新时间: 2017-02-17