首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

如何把gb2321转换为utf-8

2011-12-18 
怎么把gb2321转换为utf-8怎么把gb2321转换为utf-8 谢谢大侠们先 请您留下您宝贵的解决方法 还有怎么把word

怎么把gb2321转换为utf-8
怎么把gb2321转换为utf-8 谢谢大侠们先 请您留下您宝贵的解决方法 
还有怎么把word转换成htmi 
另存为的话 word   会出现丢失内容 谢谢 工作难题

[解决办法]
可以使用String类中的public byte[] getBytes(String charsetName)。
比如说你的数据是GB2312,那么可以这么
GB2312String.getBytes( "UTF-8 " );

[解决办法]
try {
temp = new String((new String(str)).getBytes( "gb2321 "),
"utf-8 ");
} catch (java.io.UnsupportedEncodingException e) {
e.printStackTrace();
}
[解决办法]
temp = new String((new String(str)).getBytes( "gb2321 "), "utf-8 ");
正解!

[解决办法]
........................................
建议楼主先学基础

热点排行