| @@ 307-318 (lines=12) @@ | ||
| 304 | * @return string |
|
| 305 | * The string in uppercase. |
|
| 306 | */ |
|
| 307 | public static function strtoupper($text) { |
|
| 308 | if (static::getStatus() == static::STATUS_MULTIBYTE) { |
|
| 309 | return mb_strtoupper($text); |
|
| 310 | } |
|
| 311 | else { |
|
| 312 | // Use C-locale for ASCII-only uppercase. |
|
| 313 | $text = strtoupper($text); |
|
| 314 | // Case flip Latin-1 accented letters. |
|
| 315 | $text = preg_replace_callback('/\xC3[\xA0-\xB6\xB8-\xBE]/', '\Drupal\Component\Utility\Unicode::caseFlip', $text); |
|
| 316 | return $text; |
|
| 317 | } |
|
| 318 | } |
|
| 319 | ||
| 320 | /** |
|
| 321 | * Converts a UTF-8 string to lowercase. |
|
| @@ 329-340 (lines=12) @@ | ||
| 326 | * @return string |
|
| 327 | * The string in lowercase. |
|
| 328 | */ |
|
| 329 | public static function strtolower($text) { |
|
| 330 | if (static::getStatus() == static::STATUS_MULTIBYTE) { |
|
| 331 | return mb_strtolower($text); |
|
| 332 | } |
|
| 333 | else { |
|
| 334 | // Use C-locale for ASCII-only lowercase. |
|
| 335 | $text = strtolower($text); |
|
| 336 | // Case flip Latin-1 accented letters. |
|
| 337 | $text = preg_replace_callback('/\xC3[\x80-\x96\x98-\x9E]/', '\Drupal\Component\Utility\Unicode::caseFlip', $text); |
|
| 338 | return $text; |
|
| 339 | } |
|
| 340 | } |
|
| 341 | ||
| 342 | /** |
|
| 343 | * Capitalizes the first character of a UTF-8 string. |
|