1 public class Chinese { 2 public static String toUnicode(String strvalue) { 3 try { 4 if (strvalue == null) { 5 return null; 6 } 7 else { 8 strvalue = new String(strvalue.getBytes("GBK"), "ISO8859_1"); 9 return strvalue; 10 } 11 } 12 catch (Exception e) { 13 return ""; 14 } 15 } 16 17 public static String toChinese(String strvalue) { 18 try { 19 if (strvalue == null) { 20 return ""; 21 } 22 else { 23 strvalue = new String(strvalue.getBytes("ISO8859_1"), "GBK"); 24 return strvalue; 25 } 26 } 27 catch (Exception e) { 28 return ""; 29 } 30 } 31 32 public static String chinese(String a) { 33 try { 34 return new String(a.getBytes("ISO-8859-1")); 35 } 36 catch (UnsupportedEncodingException ex) { 37 return null; 38 } 39 } 40 }