1. 利用java工具将中文转换成unicode方法:
a. 先在目录A中建立两个空白文件: 1.property, 2.property
b. 将要转换的文字放到1.property中,如: valueError1=字段输入错误
c. 从cmd进入到目录A,执行以下命令:
native2ascii -encoding gb2312 1.property 2.property
d.命令完成后,2.property中valueError1=后面的内容即为"字段输入错误"的unicode码
2. 判断字符串中是否有中文字符或是其它unicode字符的简单方法:
if (str.getbyte().length != str.length() )