隨筆 - 100  文章 - 50  trackbacks - 0
          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿(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;
          }
          }??
          寫進數據庫時用ChineseToUnicode()方法進行編碼,讀出來的時候用UnicodeToChinese()方法進行解碼既可
          ?

          posted on 2006-08-11 17:01 fly 閱讀(326) 評論(0)  編輯  收藏 所屬分類: jsp學習
          主站蜘蛛池模板: 凤山市| 诏安县| 永定县| 扬中市| 来宾市| 中西区| 淮北市| 松溪县| 沁源县| 松江区| 拜城县| 沾益县| 广东省| 甘南县| 阿城市| 同江市| 黔西| 五华县| 瓦房店市| 民丰县| 普宁市| 明星| 平顶山市| 长治市| 光泽县| 山东省| 棋牌| 阳城县| 云和县| 怀化市| 广东省| 日土县| 洛扎县| 和政县| 沙坪坝区| 泾川县| 万宁市| 仙居县| 平泉县| 三亚市| 永城市|