wikimedia/equivset
最新稳定版本:1.7.1
Composer 安装命令:
composer require wikimedia/equivset
包简介
Visually Equivalent Set of UTF-8 Characters
README 文档
README
A mapping of "equivalent" or similar-looking characters (homoglyphs) to prevent spoofing. This is similar to the Unicode Consortium's confusables.txt with some significant differences. Confusables.txt lists character pairs that are visually identical or nearly identical, for example, Latin "A" and Greek "Α" (alpha). This list is much broader, including pairs that merely look similar, for example, "S" and "$". Another difference is that this list only includes letters and punctuation. It does not include symbols, emoji, or graphical elements.
Installation
Using composer: Add the following to the composer.json file for your project:
{
"require": {
"wikimedia/equivset": "^1.0.0"
}
}
And then run composer update.
Usage
use Wikimedia\Equivset\Equivset; $equivset = new Equivset(); // Normalize a string echo $equivset->normalize( 'sp00f' ); // SPOOF // Get a single character. if ( $equivset->has( 'ɑ' ) ) { $char = $equivset->get( 'ɑ' ); } echo $char; // A // Loop over entire set. foreach ( $equivset as $char => $equiv ) { // Do something. } // Get the entire set. $all = $equivset->all();
Contributing
All changes should be made to ./data/equivset.in. Then run
bin/console generate-equivset to generate the JSON, PHP, and plain
text versions of the equivset in ./dist.
When releasing, update HISTORY.md with git log --format='* %s (%aN)' --topo-order
to consistently list commits.
统计信息
- 总下载量: 204.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2017-10-06