43 if (self::hasNormalizerSupport()) {
44 $nfc = normalizer_normalize(
$string);
45 if (is_string($nfc)) {
59 "\xE2\x82\xAC" =>
' E ',
60 "\xC2\xA3" =>
' GBP ',
93 $words = preg_split($pattern,
$string, -1, PREG_SPLIT_NO_EMPTY);
96 $words = array_map(
'urlencode', $words);
99 return implode($separator, $words);
110 if (!preg_match(
'/[\x80-\xff]/', $utf8)) {
114 $map = self::getAsciiTranslitMap();
116 return strtr($utf8, $map);
127 "\xC2\xAA" =>
'a',
"\xC2\xBA" =>
'o',
"\xC3\x80" =>
'A',
128 "\xC3\x81" =>
'A',
"\xC3\x82" =>
'A',
"\xC3\x83" =>
'A',
129 "\xC3\x84" =>
'A',
"\xC3\x85" =>
'A',
"\xC3\x86" =>
'AE',
130 "\xC3\x87" =>
'C',
"\xC3\x88" =>
'E',
"\xC3\x89" =>
'E',
131 "\xC3\x8A" =>
'E',
"\xC3\x8B" =>
'E',
"\xC3\x8C" =>
'I',
132 "\xC3\x8D" =>
'I',
"\xC3\x8E" =>
'I',
"\xC3\x8F" =>
'I',
133 "\xC3\x90" =>
'D',
"\xC3\x91" =>
'N',
"\xC3\x92" =>
'O',
134 "\xC3\x93" =>
'O',
"\xC3\x94" =>
'O',
"\xC3\x95" =>
'O',
135 "\xC3\x96" =>
'O',
"\xC3\x99" =>
'U',
"\xC3\x9A" =>
'U',
136 "\xC3\x9B" =>
'U',
"\xC3\x9C" =>
'U',
"\xC3\x9D" =>
'Y',
137 "\xC3\x9E" =>
'TH',
"\xC3\x9F" =>
'ss',
"\xC3\xA0" =>
'a',
138 "\xC3\xA1" =>
'a',
"\xC3\xA2" =>
'a',
"\xC3\xA3" =>
'a',
139 "\xC3\xA4" =>
'a',
"\xC3\xA5" =>
'a',
"\xC3\xA6" =>
'ae',
140 "\xC3\xA7" =>
'c',
"\xC3\xA8" =>
'e',
"\xC3\xA9" =>
'e',
141 "\xC3\xAA" =>
'e',
"\xC3\xAB" =>
'e',
"\xC3\xAC" =>
'i',
142 "\xC3\xAD" =>
'i',
"\xC3\xAE" =>
'i',
"\xC3\xAF" =>
'i',
143 "\xC3\xB0" =>
'd',
"\xC3\xB1" =>
'n',
"\xC3\xB2" =>
'o',
144 "\xC3\xB3" =>
'o',
"\xC3\xB4" =>
'o',
"\xC3\xB5" =>
'o',
145 "\xC3\xB6" =>
'o',
"\xC3\xB8" =>
'o',
"\xC3\xB9" =>
'u',
146 "\xC3\xBA" =>
'u',
"\xC3\xBB" =>
'u',
"\xC3\xBC" =>
'u',
147 "\xC3\xBD" =>
'y',
"\xC3\xBE" =>
'th',
"\xC3\xBF" =>
'y',
150 "\xC4\x80" =>
'A',
"\xC4\x81" =>
'a',
"\xC4\x82" =>
'A',
151 "\xC4\x83" =>
'a',
"\xC4\x84" =>
'A',
"\xC4\x85" =>
'a',
152 "\xC4\x86" =>
'C',
"\xC4\x87" =>
'c',
"\xC4\x88" =>
'C',
153 "\xC4\x89" =>
'c',
"\xC4\x8A" =>
'C',
"\xC4\x8B" =>
'c',
154 "\xC4\x8C" =>
'C',
"\xC4\x8D" =>
'c',
"\xC4\x8E" =>
'D',
155 "\xC4\x8F" =>
'd',
"\xC4\x90" =>
'D',
"\xC4\x91" =>
'd',
156 "\xC4\x92" =>
'E',
"\xC4\x93" =>
'e',
"\xC4\x94" =>
'E',
157 "\xC4\x95" =>
'e',
"\xC4\x96" =>
'E',
"\xC4\x97" =>
'e',
158 "\xC4\x98" =>
'E',
"\xC4\x99" =>
'e',
"\xC4\x9A" =>
'E',
159 "\xC4\x9B" =>
'e',
"\xC4\x9C" =>
'G',
"\xC4\x9D" =>
'g',
160 "\xC4\x9E" =>
'G',
"\xC4\x9F" =>
'g',
"\xC4\xA0" =>
'G',
161 "\xC4\xA1" =>
'g',
"\xC4\xA2" =>
'G',
"\xC4\xA3" =>
'g',
162 "\xC4\xA4" =>
'H',
"\xC4\xA5" =>
'h',
"\xC4\xA6" =>
'H',
163 "\xC4\xA7" =>
'h',
"\xC4\xA8" =>
'I',
"\xC4\xA9" =>
'i',
164 "\xC4\xAA" =>
'I',
"\xC4\xAB" =>
'i',
"\xC4\xAC" =>
'I',
165 "\xC4\xAD" =>
'i',
"\xC4\xAE" =>
'I',
"\xC4\xAF" =>
'i',
166 "\xC4\xB0" =>
'I',
"\xC4\xB1" =>
'i',
"\xC4\xB2" =>
'IJ',
167 "\xC4\xB3" =>
'ij',
"\xC4\xB4" =>
'J',
"\xC4\xB5" =>
'j',
168 "\xC4\xB6" =>
'K',
"\xC4\xB7" =>
'k',
"\xC4\xB8" =>
'k',
169 "\xC4\xB9" =>
'L',
"\xC4\xBA" =>
'l',
"\xC4\xBB" =>
'L',
170 "\xC4\xBC" =>
'l',
"\xC4\xBD" =>
'L',
"\xC4\xBE" =>
'l',
171 "\xC4\xBF" =>
'L',
"\xC5\x80" =>
'l',
"\xC5\x81" =>
'L',
172 "\xC5\x82" =>
'l',
"\xC5\x83" =>
'N',
"\xC5\x84" =>
'n',
173 "\xC5\x85" =>
'N',
"\xC5\x86" =>
'n',
"\xC5\x87" =>
'N',
174 "\xC5\x88" =>
'n',
"\xC5\x89" =>
'N',
"\xC5\x8A" =>
'n',
175 "\xC5\x8B" =>
'N',
"\xC5\x8C" =>
'O',
"\xC5\x8D" =>
'o',
176 "\xC5\x8E" =>
'O',
"\xC5\x8F" =>
'o',
"\xC5\x90" =>
'O',
177 "\xC5\x91" =>
'o',
"\xC5\x92" =>
'OE',
"\xC5\x93" =>
'oe',
178 "\xC5\x94" =>
'R',
"\xC5\x95" =>
'r',
"\xC5\x96" =>
'R',
179 "\xC5\x97" =>
'r',
"\xC5\x98" =>
'R',
"\xC5\x99" =>
'r',
180 "\xC5\x9A" =>
'S',
"\xC5\x9B" =>
's',
"\xC5\x9C" =>
'S',
181 "\xC5\x9D" =>
's',
"\xC5\x9E" =>
'S',
"\xC5\x9F" =>
's',
182 "\xC5\xA0" =>
'S',
"\xC5\xA1" =>
's',
"\xC5\xA2" =>
'T',
183 "\xC5\xA3" =>
't',
"\xC5\xA4" =>
'T',
"\xC5\xA5" =>
't',
184 "\xC5\xA6" =>
'T',
"\xC5\xA7" =>
't',
"\xC5\xA8" =>
'U',
185 "\xC5\xA9" =>
'u',
"\xC5\xAA" =>
'U',
"\xC5\xAB" =>
'u',
186 "\xC5\xAC" =>
'U',
"\xC5\xAD" =>
'u',
"\xC5\xAE" =>
'U',
187 "\xC5\xAF" =>
'u',
"\xC5\xB0" =>
'U',
"\xC5\xB1" =>
'u',
188 "\xC5\xB2" =>
'U',
"\xC5\xB3" =>
'u',
"\xC5\xB4" =>
'W',
189 "\xC5\xB5" =>
'w',
"\xC5\xB6" =>
'Y',
"\xC5\xB7" =>
'y',
190 "\xC5\xB8" =>
'Y',
"\xC5\xB9" =>
'Z',
"\xC5\xBA" =>
'z',
191 "\xC5\xBB" =>
'Z',
"\xC5\xBC" =>
'z',
"\xC5\xBD" =>
'Z',
192 "\xC5\xBE" =>
'z',
"\xC5\xBF" =>
's',
194 "\xC8\x98" =>
'S',
"\xC8\x99" =>
's',
195 "\xC8\x9A" =>
'T',
"\xC8\x9B" =>
't',
197 "\xC6\xA0" =>
'O',
"\xC6\xA1" =>
'o',
198 "\xC6\xAF" =>
'U',
"\xC6\xB0" =>
'u',
200 "\xE1\xBA\xA6" =>
'A',
"\xE1\xBA\xA7" =>
'a',
201 "\xE1\xBA\xB0" =>
'A',
"\xE1\xBA\xB1" =>
'a',
202 "\xE1\xBB\x80" =>
'E',
"\xE1\xBB\x81" =>
'e',
203 "\xE1\xBB\x92" =>
'O',
"\xE1\xBB\x93" =>
'o',
204 "\xE1\xBB\x9C" =>
'O',
"\xE1\xBB\x9D" =>
'o',
205 "\xE1\xBB\xAA" =>
'U',
"\xE1\xBB\xAB" =>
'u',
206 "\xE1\xBB\xB2" =>
'Y',
"\xE1\xBB\xB3" =>
'y',
208 "\xE1\xBA\xA2" =>
'A',
"\xE1\xBA\xA3" =>
'a',
209 "\xE1\xBA\xA8" =>
'A',
"\xE1\xBA\xA9" =>
'a',
210 "\xE1\xBA\xB2" =>
'A',
"\xE1\xBA\xB3" =>
'a',
211 "\xE1\xBA\xBA" =>
'E',
"\xE1\xBA\xBB" =>
'e',
212 "\xE1\xBB\x82" =>
'E',
"\xE1\xBB\x83" =>
'e',
213 "\xE1\xBB\x88" =>
'I',
"\xE1\xBB\x89" =>
'i',
214 "\xE1\xBB\x8E" =>
'O',
"\xE1\xBB\x8F" =>
'o',
215 "\xE1\xBB\x94" =>
'O',
"\xE1\xBB\x95" =>
'o',
216 "\xE1\xBB\x9E" =>
'O',
"\xE1\xBB\x9F" =>
'o',
217 "\xE1\xBB\xA6" =>
'U',
"\xE1\xBB\xA7" =>
'u',
218 "\xE1\xBB\xAC" =>
'U',
"\xE1\xBB\xAD" =>
'u',
219 "\xE1\xBB\xB6" =>
'Y',
"\xE1\xBB\xB7" =>
'y',
221 "\xE1\xBA\xAA" =>
'A',
"\xE1\xBA\xAB" =>
'a',
222 "\xE1\xBA\xB4" =>
'A',
"\xE1\xBA\xB5" =>
'a',
223 "\xE1\xBA\xBC" =>
'E',
"\xE1\xBA\xBD" =>
'e',
224 "\xE1\xBB\x84" =>
'E',
"\xE1\xBB\x85" =>
'e',
225 "\xE1\xBB\x96" =>
'O',
"\xE1\xBB\x97" =>
'o',
226 "\xE1\xBB\xA0" =>
'O',
"\xE1\xBB\xA1" =>
'o',
227 "\xE1\xBB\xAE" =>
'U',
"\xE1\xBB\xAF" =>
'u',
228 "\xE1\xBB\xB8" =>
'Y',
"\xE1\xBB\xB9" =>
'y',
230 "\xE1\xBA\xA4" =>
'A',
"\xE1\xBA\xA5" =>
'a',
231 "\xE1\xBA\xAE" =>
'A',
"\xE1\xBA\xAF" =>
'a',
232 "\xE1\xBA\xBE" =>
'E',
"\xE1\xBA\xBF" =>
'e',
233 "\xE1\xBB\x90" =>
'O',
"\xE1\xBB\x91" =>
'o',
234 "\xE1\xBB\x9A" =>
'O',
"\xE1\xBB\x9B" =>
'o',
235 "\xE1\xBB\xA8" =>
'U',
"\xE1\xBB\xA9" =>
'u',
237 "\xE1\xBA\xA0" =>
'A',
"\xE1\xBA\xA1" =>
'a',
238 "\xE1\xBA\xAC" =>
'A',
"\xE1\xBA\xAD" =>
'a',
239 "\xE1\xBA\xB6" =>
'A',
"\xE1\xBA\xB7" =>
'a',
240 "\xE1\xBA\xB8" =>
'E',
"\xE1\xBA\xB9" =>
'e',
241 "\xE1\xBB\x86" =>
'E',
"\xE1\xBB\x87" =>
'e',
242 "\xE1\xBB\x8A" =>
'I',
"\xE1\xBB\x8B" =>
'i',
243 "\xE1\xBB\x8C" =>
'O',
"\xE1\xBB\x8D" =>
'o',
244 "\xE1\xBB\x98" =>
'O',
"\xE1\xBB\x99" =>
'o',
245 "\xE1\xBB\xA2" =>
'O',
"\xE1\xBB\xA3" =>
'o',
246 "\xE1\xBB\xA4" =>
'U',
"\xE1\xBB\xA5" =>
'u',
247 "\xE1\xBB\xB0" =>
'U',
"\xE1\xBB\xB1" =>
'u',
248 "\xE1\xBB\xB4" =>
'Y',
"\xE1\xBB\xB5" =>
'y',
260 $form_c =
"\xC3\x85";
261 $form_d =
"A\xCC\x8A";
262 $ret = (function_exists(
'normalizer_normalize')
263 && $form_c === normalizer_normalize($form_d));
static hasNormalizerSupport()
Tests that "normalizer_normalize" exists and works.
static transliterateAscii($utf8)
Transliterate Western multibyte chars to ASCII.
static getAsciiTranslitMap()
Get array of UTF-8 (NFC) character replacements.
static urlize($string, $separator= '-')
Create a version of a string for embedding in a URL.