JDK中自带的native2ascii功能还是比较强的。简单做以下介绍。
1、只转换特定字符
native2ascii
在控制台中可以输入汉字回车后,就可以看到转移后的字符了。
Ctrl+C退出。
2、转换properties文件
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
将文件allMessages_zh_CN.input.properties编码后输出为allMessages_zh_CN.properties。
为了方便properties文件的管理,建议纯中文的配置文件用input命名。
3、反向单一properties文件
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
注意-reverse参数
4、批量反向所有的properties文件
使用工具UncodeReverse.exe
详见:批量转换Uncode编码的文件,地址 http://blog.csdn.net/z3h/archive/2008/01/25/2065912.aspx