opencc4j icon indicating copy to clipboard operation
opencc4j copied to clipboard

字符串中存在繁体和其它符号,isTraditional给出结果为false

Open Light-Towers opened this issue 1 year ago • 0 comments

public static void main(String[] args) {
    String s = "( 台灣 )";
    String simple = ZhConverterUtil.toSimple(s);
    System.out.println(simple);
    System.out.println(ZhConverterUtil.isTraditional(s));
}

输出结果:

( 台湾 )
false

看了下源码,只要有非中文的,直接返回false了。感觉校验前,需要对校验的字符串进行处理下 image

Light-Towers avatar Jul 04 '24 05:07 Light-Towers