From 3f9523ff2f98724720c82524582ef3b3e4c6a5ee Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 13 Feb 2012 01:34:57 +0000 Subject: [PATCH] * allow custom replacement for non-ascii chars --- .../net/sourceforge/filebot/format/ExpressionFormat.lib.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy index 0f2b860f..03581890 100644 --- a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy +++ b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy @@ -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) }