中文输出出现乱码

来源:互联网 发布:拍双重曝光软件 编辑:程序博客网 时间:2024/03/29 04:16

 对于此种情况,使用下面这个方法,进行转变即可

public String toChinese(String ss)
 {
    try{
       String temp_p=ss;
       byte[] temp_t=temp_p.getBytes("ISO8859-1");
       ss=new String(temp_t);
       }catch(Exception e){
          System.err.println("toChinese exception:"+e.getMessage());
          System.err.println("The String is :"+ss);
       }
       return ss;
 
 }

原创粉丝点击