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

          posted on 2006-08-11 17:01 fly 閱讀(332) 評論(0)  編輯  收藏 所屬分類: jsp學習
          主站蜘蛛池模板: 连山| 韶山市| 浦北县| 南汇区| 烟台市| 文安县| 邵东县| 商城县| 新化县| 南溪县| 府谷县| 米泉市| 孟州市| 内黄县| 温州市| 洱源县| 通海县| 攀枝花市| 临漳县| 卢龙县| 宾川县| 大冶市| 金山区| 东港市| 鄯善县| 古丈县| 姜堰市| 怀宁县| 贵州省| 吉水县| 岚皋县| 太仆寺旗| 南木林县| 信阳市| 梓潼县| 个旧市| 长子县| 颍上县| 长沙市| 湖南省| 云梦县|