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

裸求,诸位帮忙,JAVA中SJIS编码转换JISCode编码怎么实现,100分答案正确立即结贴

2011-12-31 
裸求,诸位帮忙,JAVA中SJIS编码转换JISCode编码如何实现,100分答案正确立即结贴如题:privatebyte[]stringCo

裸求,诸位帮忙,JAVA中SJIS编码转换JISCode编码如何实现,100分答案正确立即结贴
如题:
private   byte[]   stringCovertEUCCode(String   titenName){
            byte   temp[]=titenName.getBytes();
            byte[]   jiscode   =   null;
            try{
                  String   content=new   String(temp, "EUCJIS ");
jiscode   =   content.getBytes( "JIS ");
            }catch(Exception   es){
System.out.println(es.getMessage().toString());
            }
            for(int   i=0;i <jiscode.length;i++){
System.out.println(jiscode[i]);
            }
            return   jiscode;
}
================================================================
但是不对,在线等.


[解决办法]
应该是这样吧...?
private static byte[] stringCovertEUCCode(byte[] eucjis) {
byte[] jiscode = null;
try {
String content = new String(eucjis, "EUCJIS ");
jiscode = content.getBytes( "JIS ");
} catch (Exception es) {
System.out.println(es.getMessage().toString());
}
for (int i = 0; i < jiscode.length; i++) {
System.out.println(jiscode[i]);
}
return jiscode;
}
[解决办法]
又跟着学了一手嘻嘻~~~

热点排行