posts - 33,  comments - 17,  trackbacks - 0
           1/**
           2 * Big5字與Unicode的互換
           3 * 轉換后的正常字型
           4 */

           5
           6import java.io.*;
           7
           8public class MyUtil{
           9    public static String big5ToUnicode(String s){
          10        try{
          11            return new String(s.getBytes("ISO8859_1"), "Big5");
          12        }

          13        catch (UnsupportedEncodingException uee){
          14            return s;
          15        }

          16    }

          17
          18    public static String UnicodeTobig5(String s){
          19        try{
          20            return new String(s.getBytes("Big5"), "ISO8859_1");
          21        }

          22        catch (UnsupportedEncodingException uee){
          23            return s;
          24        }

          25    }

          26
          27    public static String toHexString(String s){
          28        String str="";
          29        for (int i=0; i<s.length(); i++){
          30            int ch=(int)s.charAt(i);
          31            String s4="0000"+Integer.toHexString(ch);
          32            str=str+s4.substring(s4.length()-4)+" ";
          33        }

          34        return str;
          35    }

          36}
          posted on 2008-07-23 17:37 scea2009 閱讀(264) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          <2008年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          PL/SQL存儲過程與函數

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 阿拉尔市| 三门县| 裕民县| 敖汉旗| 青神县| 华安县| 西乡县| 基隆市| 沽源县| 留坝县| 东乡| 新巴尔虎左旗| 彭水| 运城市| 乌兰浩特市| 绍兴市| 舒城县| 木里| 卢氏县| 岳西县| 屯留县| 武隆县| 尉氏县| 天津市| 临夏市| 宁德市| 德钦县| 喀喇沁旗| 三台县| 巩留县| 泰安市| 宜君县| 无棣县| 靖边县| 平顺县| 鹤岗市| 闽侯县| 南京市| 章丘市| 泰宁县| 泰顺县|