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

          posted on 2006-08-11 17:01 fly 閱讀(326) 評論(0)  編輯  收藏 所屬分類: jsp學習
          主站蜘蛛池模板: 常州市| 东安县| 宜春市| 连江县| 宣城市| 洛宁县| 泸西县| 忻城县| 云龙县| 高州市| 丹棱县| 天峨县| 松溪县| 景宁| 定日县| 丘北县| 克东县| 阳泉市| 囊谦县| 巩义市| 隆德县| 闵行区| 丹巴县| 固安县| 泰兴市| 平凉市| 冀州市| 兖州市| 鄯善县| 虹口区| 岳西县| 博兴县| 陕西省| 阿尔山市| 休宁县| 新昌县| 泊头市| 宝清县| SHOW| 大理市| 三门峡市|