隨筆 - 100  文章 - 50  trackbacks - 0
          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          我收藏的一些文章!

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜


          public static String UnicodeToChinese(String s) {
          try {
          if (s == null || s.equals(""))
          return "";
          String newstring = null;
          newstring = new String(s.getBytes("ISO8859_1"), "gb2312");
          return newstring;
          } catch (UnsupportedEncodingException e) {
          return s;
          }
          }

          public static String ChineseToUnicode(String s) {
          try {
          if (s == null || s.equals(""))
          return "";
          String newstring = null;
          newstring = new String(s.getBytes("gb2312"), "ISO8859_1");
          return newstring;
          } catch (UnsupportedEncodingException e) {
          return s;
          }
          }??
          寫進(jìn)數(shù)據(jù)庫時用ChineseToUnicode()方法進(jìn)行編碼,讀出來的時候用UnicodeToChinese()方法進(jìn)行解碼既可
          ?

          posted on 2006-08-11 17:01 fly 閱讀(332) 評論(0)  編輯  收藏 所屬分類: jsp學(xué)習(xí)
          主站蜘蛛池模板: 清水河县| 朝阳市| 正安县| 图们市| 陆河县| 丰镇市| 北辰区| 濉溪县| 延庆县| 乡宁县| 陆河县| 荥经县| 丹棱县| 开化县| 姜堰市| 琼中| 盘山县| 梅河口市| 葫芦岛市| 荆门市| 永寿县| 荔浦县| 武宣县| 神木县| 茂名市| 临安市| 阜城县| 延川县| 诸暨市| 若尔盖县| 陆川县| 班戈县| 盖州市| 榕江县| 山东省| 西平县| 河东区| 逊克县| 长沙市| 泽普县| 礼泉县|