3

Perl 5 在 CPAN 上有一个名为Text::Unidecode将 Unicode 音译为 ASCII 的模块。因此,例如,如果您将 string"“北亰 — it’s the best”"交给它,它会将 string 交回"\"Bei Jing -- it's the best\""。快速搜索 Java 库来做同样的事情只会发现会去除 Unicode 字符或将重音字符转换为非重音字符的代码。

有谁知道产生类似输出的 Java 库Text::Unidecode

4

2 回答 2

1

一个快速的谷歌说: http: //junidecode.sourceforge.net/ - 但看起来它已经有一段时间没有更新了。

于 2013-07-02T15:31:30.203 回答
-1

Java 还有另一个库:unidecode

与 Gradle 一起使用:

compile 'cz.jirutka.unidecode:unidecode:1.0.1'

与 Maven 一起使用:

<dependency>
    <groupId>cz.jirutka.unidecode</groupId>
    <artifactId>unidecode</artifactId>
    <version>1.0.1</version>
</dependency>
于 2015-07-09T23:03:28.920 回答