class PHPTransliteration

Same name in this branch

Implements transliteration without using the PECL extensions.

Transliterations are done character-by-character, by looking up non-US-ASCII characters in a transliteration database.

The database comes from two types of files, both of which are searched for in the PHPTransliteration::$dataDirectory directory. First, language-specific overrides are searched (see PHPTransliteration::readLanguageOverrides()). If there is no language-specific override for a character, the generic transliteration character tables are searched (see PHPTransliteration::readGenericData()). If looking up the character in the generic table results in a NULL value, or an illegal character is encountered, then a substitute character is returned.

Hierarchy

Expanded class hierarchy of PHPTransliteration

1 file declares its use of PHPTransliteration

File

drupal/core/lib/Drupal/Component/Transliteration/PHPTransliteration.php, line 29
Definition of \Drupal\Component\Transliteration\PHPTransliteration.

Namespace

Drupal\Component\Transliteration
View source

Members

Namesort descending Modifiers Type Description Overrides
PHPTransliteration::$dataDirectory protected property Directory where data for transliteration resides.
PHPTransliteration::$genericMap protected property Non-language-specific transliteration tables.
PHPTransliteration::$languageOverrides protected property Associative array of language-specific character transliteration tables.
PHPTransliteration::ordUTF8 protected static function Finds the character code for a UTF-8 character: like ord() but for UTF-8.
PHPTransliteration::readGenericData protected function Reads in generic transliteration data for a bank of characters.
PHPTransliteration::readLanguageOverrides protected function Reads in language overrides for a language code. 1
PHPTransliteration::replace protected function Replaces a single Unicode character using the transliteration database.
PHPTransliteration::transliterate public function Implements TransliterationInterface::transliterate(). Overrides TransliterationInterface::transliterate
PHPTransliteration::__construct public function Constructs a transliteration object.