1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00

* allow custom replacement for non-ascii chars

This commit is contained in:
Reinhard Pointner 2012-02-13 01:34:57 +00:00
parent b314725186
commit 3f9523ff2f

View File

@ -132,4 +132,4 @@ String.metaClass.transliterate = { transformIdentifier -> com.ibm.icu.text.Trans
* e.g. "Österreich" -> "Osterreich"
* "カタカナ" -> "katakana"
*/
String.metaClass.ascii = { delegate.transliterate("Any-Latin;Latin-ASCII;[:Diacritic:]remove").replaceAll("[^\\p{ASCII}]", "?") }
String.metaClass.ascii = { fallback = '?' -> delegate.transliterate("Any-Latin;Latin-ASCII;[:Diacritic:]remove").replaceAll("[^\\p{ASCII}]", fallback) }