protected function PHPTransliteration::readGenericData

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 hexidecimal 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.

Parameters

$bank: First two bytes of the Unicode character, or 0 for the ASCII range.

1 call to PHPTransliteration::readGenericData()
PHPTransliteration::replace in drupal/core/lib/Drupal/Component/Transliteration/PHPTransliteration.php
Replaces a single Unicode character using the transliteration database.

File

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

Class

PHPTransliteration
Implements transliteration without using the PECL extensions.

Namespace

Drupal\Component\Transliteration

Code

protected function readGenericData($bank) {

  // Figure out the file name.
  $file = $this->dataDirectory . '/x' . sprintf('%02x', $bank) . '.php';

  // Read in this file, which should set up a variable called $base, which
  // will be local to this function.
  if (is_file($file)) {
    include $file;
  }
  if (!isset($base) || !is_array($base)) {
    $base = array();
  }

  // Save this data.
  $this->genericMap[$bank] = $base;
}