1.20.x transliteration.inc transliteration_get($text, $unknown = '?', $source_langcode = NULL)

Transliterates text.

Takes an input string in any language and character set, and tries to represent it in US-ASCII characters by conveying, in Roman letters, the pronunciation expressed by the text in some other writing system.

Parameters

string $text: UTF-8 encoded text input.

string $unknown: Replacement string for characters that do not have a suitable ASCII equivalent.

string $source_langcode: Optional ISO 639 language code that denotes the language of the input and is used to apply language-specific variations. If the source language is not known at the time of transliteration, it is recommended to set this argument to the site default language to produce consistent results. Otherwise the current display language will be used.

Return value

Transliterated text.:

See also

language_default()

File

includes/transliteration.inc, line 284
Transliteration processing functions.

Code

function transliteration_get($text, $unknown = '?', $source_langcode = NULL) {
  // Populate defaults.
  if (empty($source_langcode)) {
    $source_langcode = $GLOBALS['language']->langcode;
  }
  return _transliteration_process($text, $unknown, $source_langcode);
}