/ * Encoding conversion, make sure there is no garbled * / package dbjavabe when writing the database.
public class CodingConvert {public CodingConvert () {//} public String toGb (String uniStr) {String gbStr = ""; if (uniStr == null) {uniStr = "";} try {byte [] tempByte = uniStr.getBytes ("ISO8859_1"); GBSTR = New String (Tempbyte, "GB2312");} Catch (Exception EX) {} Return GBSTR;} Public String Touni (String GBSTR) {String Unistr = ""; IF (GBSTR == NULL ) {GBSTR = "";} try {byte [] tempbyte = gbstr.getbytes ("gb2312"); unistr = new string (Tempbyte, "ISO8859_1");} catCH (Exception EX) {} Return Unistr;}}