encodingchange.java

来自「基于jsp的固定资产管理系统,自己做的」· Java 代码 · 共 29 行

JAVA
29
字号
package DAO;

public class EncodingChange {

    public   static   String   getWriteStr(String   str)   {   
        try   {   
                String   temp_p   =   str;   
                byte[]   temp_t   =   temp_p.getBytes("GBK");   
                String   unicode   =   new   String(temp_t,"ISO8859-1");   
                return   unicode;   
        }   
        catch(Exception   e)   {   
                return   "null";   
        }   
}   

public   static   String   getReadStr(String   str)   {   
        try   {   
                String   temp_p   =   str;   
                byte[]   temp_t   =   temp_p.getBytes("ISO8859-1");   
                String   unicode   =   new   String(temp_t,"GBK");   
                return   unicode;   
        }   
        catch(Exception   e)   {   
                return   "null";   
        }   
}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?