📄 transcode.java
字号:
package com.hanb.log.tool;
/*
* Author :moonzhao
*
*处理码制转换的类
*中文是乱码的时候,通过toChinese()方法转换成汉字;
*/
public class TransCode {
public TransCode(){
}
public String toChinese(String ss) {
//处理中文问题,实现编码转换
if (ss != null) {
try {
String temp_p = ss;
byte[] temp_t = temp_p.getBytes("ISO8859-1");
ss = new String(temp_t,"GB2312");
} catch (Exception e) {
System.err.println("toChinese exception:" + e.getMessage());
System.err.println("The String is:" + ss);
}
}
return ss;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -