PhpTransliteration::__construct

public PhpTransliteration::__construct($data_directory = NULL) Constructs a transliteration object. Parameters string $data_directory: (optional) The directory where data files reside. If omitted, defaults to subdirectory 'data' underneath the directory where the class's PHP file resides. File core/lib/Drupal/Component/Transliteration/PhpTransliteration.php, line 69 Class PhpTransliteration Implements transliteration without using the PECL extensions. Namespace Drupal\Component\Transli

PhpTransliteration::transliterate

public PhpTransliteration::transliterate($string, $langcode = 'en', $unknown_character = '?', $max_length = NULL) Transliterates text from Unicode to US-ASCII. Parameters string $string: The string to transliterate. string $langcode: (optional) The language code of the language the string is in. Defaults to 'en' if not provided. Warning: this can be unfiltered user input. string $unknown_character: (optional) The character to substitute for characters in $string without transliterated equivale

PhpTransliteration::replace

protected PhpTransliteration::replace($code, $langcode, $unknown_character) Replaces a single Unicode character using the transliteration database. Parameters int $code: The character code of a Unicode character. string $langcode: The language code of the language the character is in. string $unknown_character: The character to substitute for characters without transliterated equivalents. Return value string US-ASCII replacement character. If it has a mapping, it is returned; otherwise, $unkn

PhpTransliteration::removeDiacritics

public PhpTransliteration::removeDiacritics($string) Removes diacritics (accents) from certain letters. This only applies to certain letters: Accented Latin characters like a-with-acute-accent, in the UTF-8 character range of 0xE0 to 0xE6 and 01CD to 024F. Replacements that would result in the string changing length are excluded, as well as characters that are not accented US-ASCII letters. Parameters string $string: The string holding diacritics. Return value string $string with accented let

PhpTransliteration::readLanguageOverrides

protected PhpTransliteration::readLanguageOverrides($langcode) Reads in language overrides for a language code. The data is read from files named "$langcode.php" in PhpTransliteration::$dataDirectory. These files should set up an array variable $overrides with an element whose key is $langcode and whose value is an array whose keys are character codes, and whose values are their transliterations in this language. The character codes can be for any valid Unicode character, independent of the num

PhpTransliteration::readLanguageOverrides

protected PhpTransliteration::readLanguageOverrides($langcode) Overrides \Drupal\Component\Transliteration\PhpTransliteration::readLanguageOverrides(). Allows modules to alter the language-specific $overrides array by invoking hook_transliteration_overrides_alter(). Overrides PhpTransliteration::readLanguageOverrides File core/lib/Drupal/Core/Transliteration/PhpTransliteration.php, line 45 Class PhpTransliteration Enhances PhpTransliteration with an alter hook. Namespace Drupal\Core\Tra

PhpTransliteration::readGenericData

protected PhpTransliteration::readGenericData($bank) Reads in generic transliteration data for a bank of characters. The data is read in from a file named "x$bank.php" (with $bank in hexadecimal notation) in PhpTransliteration::$dataDirectory. These files should set up a variable $bank containing an array whose numerical indices are the remaining two bytes of the character code, and whose values are the transliterations of these characters into US-ASCII. Note that the maximum Unicode character

PhpTransliteration::ordUTF8

protected static PhpTransliteration::ordUTF8($character) Finds the character code for a UTF-8 character: like ord() but for UTF-8. Parameters string $character: A single UTF-8 character. Return value int The character code, or -1 if an illegal character is found. File core/lib/Drupal/Component/Transliteration/PhpTransliteration.php, line 144 Class PhpTransliteration Implements transliteration without using the PECL extensions. Namespace Drupal\Component\Transliteration Code protected

PhpTransliteration::lookupReplacement

protected PhpTransliteration::lookupReplacement($code, $unknown_character = '?') Look up the generic replacement for a UTF-8 character code. Parameters $code: The UTF-8 character code. string $unknown_character: (optional) The character to substitute for characters without entries in the replacement tables. Return value string US-ASCII replacement characters. If it has a mapping, it is returned; otherwise, $unknown_character is returned. The replacement can contain multiple characters. File c

PhpTransliteration::$moduleHandler

The module handler to execute the transliteration_overrides alter hook. Type: \Drupal\Core\Extension\ModuleHandlerInterface File core/lib/Drupal/Core/Transliteration/PhpTransliteration.php, line 21 Class PhpTransliteration Enhances PhpTransliteration with an alter hook. Namespace Drupal\Core\Transliteration Code protected $moduleHandler;