📄 convertchinese.java
字号:
package com.comingnet.tool;
import java.io.PrintStream;
public class ConvertChinese
{
public ConvertChinese()
{
}
public static String toChinese(String strvalue)
{
try
{
if(strvalue == null || strvalue.equals(""))
{
String s = "";
return s;
}
strvalue = new String(strvalue.getBytes("ISO-8859-1"), "gb2312");
strvalue = strvalue.replace(',', '\uFF0C');
strvalue = strvalue.replace('\'', '\u2018');
if(strvalue.substring(0, 1).equals("\""))
strvalue = "“"+strvalue.substring(1, strvalue.length());
String s1 = strvalue;
return s1;
}
catch(Exception e)
{
String s2 = "";
return s2;
}
}
public static String toUnicode(String strvalue)
{
try
{
if(strvalue == null || strvalue.equals(""))
{
String s = "";
return s;
} else
{
String s1 = strvalue;
return s1;
}
}
catch(Exception e)
{
String s2 = "";
return s2;
}
}
public static void main(String args[])
{
System.out.println("hello");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -