📄 numformat.java
字号:
package common;
import java.io.UnsupportedEncodingException;
public class NumFormat {
/**
* 把从数据库中查的数据进行中文化
*/
public static String transSelect(String chi)
{
String result = "";
try
{
result = new String(chi.getBytes("GBK"),"ISO-8859-1");
}
catch(UnsupportedEncodingException e)
{
System.out.println (e.toString());
}
return result;
}
/**
* 把页面的信息转成英文字节之后再放到数据库中
*/
public static String transInsert(String chi)
{
String result = "";
try
{
result = new String(chi.getBytes("ISO-8859-1"),"GBK");
}
catch(UnsupportedEncodingException e)
{
System.out.println (e.toString());
}
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -