隨筆 - 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í)
          主站蜘蛛池模板: 德清县| 罗定市| 黄平县| 会昌县| 北票市| 紫阳县| 长乐市| 云浮市| 德钦县| 千阳县| 楚雄市| 岑巩县| 无极县| 乐都县| 灵台县| 马山县| 黄大仙区| 平顶山市| 泰和县| 东乡县| 衡山县| 龙口市| 金寨县| 宁城县| 水城县| 扬州市| 武定县| 宜章县| 芮城县| 岚皋县| 桐庐县| 错那县| 阳新县| 景宁| 蓬安县| 玛多县| 青岛市| 吉木萨尔县| 延庆县| 铁岭市| 尤溪县|