日期:2014-05-20  浏览次数:20759 次

裸求,诸位帮忙,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;
}
------解决方案--------------------
又跟着学了一手嘻嘻~~~