* support icu4j unicode transliteration in order to allow unicode-to-ascii conversion in format engine
This commit is contained in:
parent
1dbe3b81c7
commit
c766513acf
|
@ -125,8 +125,8 @@
|
|||
</zipfileset>
|
||||
|
||||
<zipfileset src="${dir.lib}/icu4j.jar">
|
||||
<include name="com/ibm/icu/text/**" />
|
||||
</zipfileset>
|
||||
<include name="com/ibm/icu/**" />
|
||||
</zipfileset>
|
||||
|
||||
<zipfileset src="${dir.lib}/sublight-ws.jar">
|
||||
<include name="net/sublight/webservice/**" />
|
||||
|
|
BIN
lib/icu4j.jar
BIN
lib/icu4j.jar
Binary file not shown.
|
@ -117,3 +117,11 @@ String.metaClass.replacePart = { replacement = "" ->
|
|||
// no pattern matches, nothing to replace
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert Unicode to ASCII as best as possible. This method will translate umlauts, accents, etc to corresponding ASCII characters.
|
||||
*
|
||||
* e.g. "Österreich" -> "Osterreich"
|
||||
* "カタカナ" -> "katakana"
|
||||
*/
|
||||
String.metaClass.ascii = { com.ibm.icu.text.Transliterator.getInstance("Any-Latin;Latin-ASCII").transform(delegate).replaceAll("[^\\p{ASCII}]", "?") }
|
||||
|
|
Loading…
Reference in New Issue