mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Replace iconv() calls with Transliterator
See https://stackoverflow.com/a/35178027/954513 Closes #5377 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
194c87e363
commit
1608bf5a4e
5 changed files with 10 additions and 9 deletions
|
@ -347,6 +347,8 @@ class ExportControllerTest extends WallabagCoreTestCase
|
|||
|
||||
private function getSanitizedFilename($title)
|
||||
{
|
||||
return preg_replace('/[^A-Za-z0-9\- \']/', '', iconv('utf-8', 'us-ascii//TRANSLIT', $title));
|
||||
$transliterator = \Transliterator::createFromRules(':: Any-Latin; :: Latin-ASCII; :: NFD; :: [:Nonspacing Mark:] Remove; :: NFC;', \Transliterator::FORWARD);
|
||||
|
||||
return preg_replace('/[^A-Za-z0-9\- \']/', '', $transliterator->transliterate($title));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue