Skip to content

Commit

Permalink
Use the intl Transliterator for transliteration - resolves #3175
Browse files Browse the repository at this point in the history
  • Loading branch information
brusch committed Aug 16, 2018
1 parent 3284b85 commit 2eddced
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/Tool/Transliteration.php
Expand Up @@ -41,17 +41,9 @@ public static function toASCII($value, $language = null)
}

$value = self::_transliterationProcess($value, '~', $language);

$value = transliterator_transliterate('Any-Latin; Latin-ASCII; [^\u001F-\u007f] remove', $value);
$value = trim($value);

// then use iconv
$result = iconv('utf-8', 'ASCII//IGNORE//TRANSLIT', $value);
if (empty($result)) {
// TRANSLIT doesn't work in musl's iconv, see #859.
$result = iconv('utf-8', 'ASCII//IGNORE', $value);
}
$value = $result;

return $value;
}

Expand Down

0 comments on commit 2eddced

Please sign in to comment.