`
xmarkgogo
  • 浏览: 29601 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

properties配置文件编码格式问题

 
阅读更多

这个问题有两种办法:

第一种办法:
native2ascii -reverse -encoding gb2312 user.properties ActionName_zh_CN.properties这样以后,
你打开ActionName_zh_CN.properties的内容,再将ActionName_zh_CN.properties文件这样置:
native2ascii ActionName_zh_CN.properties userChange.properties 然后你的程序读userChange.properties的内容就可以。

第二种办法是:
可以在String username=property.getProperty("username");
之后,添加JAVA代码页可以将乱码转为中文的。用如下语句就可以了,
resultName=new String(username.getBytes("ISO-8859-1"),"gbk");


  


  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics