Implements TransliterationInterface::transliterate().
Overrides TransliterationInterface::transliterate
public function transliterate($string, $langcode = 'en', $unknown_character = '?') {
$result = '';
// Split into Unicode characters and transliterate each one.
foreach (preg_split('//u', $string, 0, PREG_SPLIT_NO_EMPTY) as $character) {
$code = self::ordUTF8($character);
if ($code == -1) {
$result .= $unknown_character;
}
else {
$result .= $this
->replace($code, $langcode, $unknown_character);
}
}
return $result;
}