Clone this repo:
  1. 4863313 Merge "Add two more main authors to composer.json" by jenkins-bot · 3 days ago master
  2. 0720aab build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 by libraryupgrader · 6 days ago
  3. 8f11c73 Add two more main authors to composer.json by thiemowmde · 7 days ago
  4. 6ea7361 Add many more mathematical and technical letter-like symbols by thiemowmde · 4 weeks ago
  5. aea7aad tests: Make data provider a static method by Umherirrender · 2 weeks ago

Equivset

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.