Skip to content

Commit

Permalink
Transliterate using PECL intl if possible. Fixes #213
Browse files Browse the repository at this point in the history
  • Loading branch information
maskas committed Oct 14, 2014
1 parent b577ea6 commit b7924e1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Ip/Internal/Text/Transliteration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
class Transliteration
{
public static function transform($string)
{
if (!function_exists('transliterator_transliterate')) {
return self::simpleTransform($string);
}

return transliterator_transliterate('Any-Latin; Latin-ASCII; [\u0100-\u7fff] remove', $string);
}

protected static function simpleTransform($string)
{

$chars_from = array(
Expand Down

0 comments on commit b7924e1

Please sign in to comment.