AsciiTransliterator
in package
Transliterates Unicode to ASCII.
If the intl extension's \Transliterator class exists, that will be used to perform the transliteration. Otherwise, the transliteration data in ./data/AsciiTransliteration_*.php will be used.
Note that the data in the AsciiTransliteration_*.php files does not produce the same output as the \Transliterator class.
Table of Contents
Properties
- $transliterator : object
Methods
- toAscii() : string
- Transliterates Unicode to ASCII.
- intl() : string
- Transliterates Unicode to ASCII using the \Transliterator class.
- manual() : string
- Transliterates Unicode to ASCII manually.
Properties
$transliterator
private
static object
$transliterator
An instance of \Transliterator to be used by self::intl().
Methods
toAscii()
Transliterates Unicode to ASCII.
public
static toAscii(string $string) : string
Parameters
- $string : string
-
A UTF-8 string.
Return values
string —An ASCII string.
intl()
Transliterates Unicode to ASCII using the \Transliterator class.
protected
static intl(string $string) : string
MOD AUTHORS: If you want to adjust how the transliteration is performed, use the integrate_ascii_transliterator_id hook to change the identifiers that are used to construct the transliterator.
Parameters
- $string : string
-
A UTF-8 string.
Tags
Return values
string —An ASCII string.
manual()
Transliterates Unicode to ASCII manually.
protected
static manual(string $string) : string
MOD AUTHORS: If you want to adjust how the transliteration is performed, use the integrate_ascii_transliterator_chars hook to customize how the individual characters are transliterated.
Parameters
- $string : string
-
A UTF-8 string.
Return values
string —An ASCII string.