function TransliterationInterface::transliterate

Same name in other branches
  1. 9 core/lib/Drupal/Component/Transliteration/TransliterationInterface.php \Drupal\Component\Transliteration\TransliterationInterface::transliterate()
  2. 8.9.x core/lib/Drupal/Component/Transliteration/TransliterationInterface.php \Drupal\Component\Transliteration\TransliterationInterface::transliterate()
  3. 11.x core/lib/Drupal/Component/Transliteration/TransliterationInterface.php \Drupal\Component\Transliteration\TransliterationInterface::transliterate()

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 equivalents. Defaults to '?'.

int $max_length: (optional) If provided, return at most this many characters, ensuring that the transliteration does not split in the middle of an input character's transliteration.

Return value

string $string with non-US-ASCII characters transliterated to US-ASCII characters, and unknown characters replaced with $unknown_character.

1 method overrides TransliterationInterface::transliterate()
PhpTransliteration::transliterate in core/lib/Drupal/Component/Transliteration/PhpTransliteration.php
Transliterates text from Unicode to US-ASCII.

File

core/lib/Drupal/Component/Transliteration/TransliterationInterface.php, line 48

Class

TransliterationInterface
Defines an interface for classes providing transliteration.

Namespace

Drupal\Component\Transliteration

Code

public function transliterate($string, $langcode = 'en', $unknown_character = '?', $max_length = NULL);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.