Replace éàçè… with equivalent “eace” In GWT

后端 未结 2 1733
感情败类
感情败类 2021-01-14 21:42

I tried s=Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll(\"[^\\\\p{ASCII}]\", \"\"); But it seems that GWT API doesn\'t provide such fonction.

相关标签:
2条回答
  • 2021-01-14 21:56

    You can take ASCII folding filter from Lucene and add to your project. You can just take foldToASCII() method from ASCIIFoldingFilter (the method does not have any dependencies). There is also a patch in Jira that has a full class for that without any dependencies - see here. It should be compiled by GWT without any problems. License should be also OK, since it is Apache License, but don't quote me on it - you should ask a real lawyer.

    0 讨论(0)
  • 2021-01-14 21:58

    @okrasz, the foldToASCII() worked but I found a shorter one Transform a String to URL standard String in Java

    0 讨论(0)
提交回复
热议问题