Coverage Report - jp.co.y_net.amm.common.AppStringUtils
 
Classes in this File Line Coverage Branch Coverage Complexity
AppStringUtils
0%
0/255
0%
0/324
0
 
 1  
 package jp.co.y_net.amm.common;
 2  
 
 3  
 import java.io.UnsupportedEncodingException;
 4  
 import java.util.HashMap;
 5  
 import java.util.Iterator;
 6  
 import java.util.Map;
 7  
 
 8  
 import org.apache.wicket.model.Model;
 9  
 
 10  
 
 11  0
 public class AppStringUtils {
 12  
     
 13  
     public static String trim(String src) {
 14  0
         if(src == null) return "";
 15  0
         return src.trim();
 16  
     }
 17  
     public static String trim(Model<ChoiceElement> ceModel) {
 18  0
         if(ceModel == null) return "";
 19  0
         if(ceModel.getObject() == null) return "";
 20  0
         return  trim(ceModel.getObject().getId());
 21  
     }
 22  
     public static String trimHalf(String str) {
 23  0
         return convZenkakuToHankaku(trim(str));
 24  
     }
 25  
     
 26  
     
 27  
     
 28  
     
 29  
     
 30  
     
 31  
     
 32  
     
 33  
     /* ------------------------------------------------------------------------------------------------------------ */
 34  
     /*
 35  
      * 既存より移植
 36  
      */
 37  
     
 38  
     /** 半角カタカナ<-->全角カタカナ変換テーブル */
 39  0
     private static final String kanaHanZenTbl[][] = {
 40  
         /** 2文字構成の濁点付き半角カナ */
 41  
         /** 必ずテーブルに先頭に置いてサーチ順を優先すること */
 42  0
         { "ガ", "ガ" }, { "ギ", "ギ" }, { "グ", "グ" }, { "ゲ", "ゲ" }, { "ゴ", "ゴ" },
 43  0
         { "ザ", "ザ" }, { "ジ", "ジ" }, { "ズ", "ズ" }, { "ゼ", "ゼ" }, { "ゾ", "ゾ" },
 44  0
         { "ダ", "ダ" }, { "ヂ", "ヂ" }, { "ヅ", "ヅ" }, { "デ", "デ" }, { "ド", "ド" },
 45  0
         { "バ", "バ" }, { "ビ", "ビ" }, { "ブ", "ブ" }, { "ベ", "ベ" }, { "ボ", "ボ" },
 46  0
         { "パ", "パ" }, { "ピ", "ピ" }, { "プ", "プ" }, { "ペ", "ペ" }, { "ポ", "ポ" },
 47  0
         { "ヴ", "ヴ" },
 48  
         /** 1文字構成の半角カナ */
 49  0
         { "ア", "ア" }, { "イ", "イ" }, { "ウ", "ウ" }, { "エ", "エ" }, { "オ", "オ" },
 50  0
         { "カ", "カ" }, { "キ", "キ" }, { "ク", "ク" }, { "ケ", "ケ" }, { "コ", "コ" },
 51  0
         { "サ", "サ" }, { "シ", "シ" }, { "ス", "ス" }, { "セ", "セ" }, { "ソ", "ソ" },
 52  0
         { "タ", "タ" }, { "チ", "チ" }, { "ツ", "ツ" }, { "テ", "テ" }, { "ト", "ト" },
 53  0
         { "ナ", "ナ" }, { "ニ", "ニ" }, { "ヌ", "ヌ" }, { "ネ", "ネ" }, { "ノ", "ノ" },
 54  0
         { "ハ", "ハ" }, { "ヒ", "ヒ" }, { "フ", "フ" }, { "ヘ", "ヘ" }, { "ホ", "ホ" },
 55  0
         { "マ", "マ" }, { "ミ", "ミ" }, { "ム", "ム" }, { "メ", "メ" }, { "モ", "モ" },
 56  0
         { "ヤ", "ヤ" }, { "ユ", "ユ" }, { "ヨ", "ヨ" },
 57  0
         { "ラ", "ラ" }, { "リ", "リ" }, { "ル", "ル" }, { "レ", "レ" }, { "ロ", "ロ" },
 58  0
         { "ワ", "ワ" }, { "ヲ", "ヲ" }, { "ン", "ン" },
 59  0
         { "ァ", "ァ" }, { "ィ", "ィ" }, { "ゥ", "ゥ" }, { "ェ", "ェ" }, { "ォ", "ォ" },
 60  0
         { "ャ", "ャ" }, { "ュ", "ュ" }, { "ョ", "ョ" }, { "ッ", "ッ" },
 61  0
         { "。", "。" }, { "「", "「" }, { "」", "」" }, { "、", "、" }, { "・", "・" },
 62  0
         { "ー", "ー" }, { "", "" }
 63  0
     };
 64  
     /**
 65  
     * 全角→半角に変換する(英字、数字、記号、カタカナ)
 66  
     *
 67  
     * @param  対象文字列
 68  
     * @return 変換後文字列
 69  
     */
 70  
     public static String convZenkakuToHankaku(String s){
 71  
         String convStr;
 72  
 
 73  
         /** 英字、数字、記号 */
 74  0
         convStr = convZenkakuLatinCharToHankakuLatinChar(s);
 75  
 
 76  
         /** カタカナ */
 77  0
         convStr = convZenkakuKatakanaToHankakuKatakana(convStr);
 78  
 
 79  0
         return convStr;
 80  
     }
 81  
     /**
 82  
     * 全角ラテン基本文字→半角ラテン基本文字に変換する <br />
 83  
     *
 84  
     * ラテン基本文字(英字、数字、記号)
 85  
     *
 86  
     * @param  対象文字列
 87  
     * @return 変換後文字列
 88  
     */
 89  
     public static String convZenkakuLatinCharToHankakuLatinChar(String s){
 90  0
         String str = "";
 91  
 
 92  
         /** パラメータの文字列を先頭から1文字づつ調べる */
 93  0
         for (int i = 0; i < s.length(); i++) {
 94  
             /** 文字列から1文字取り出します */
 95  0
             Character c = new Character(s.substring(i, i + 1).charAt(0));
 96  
 
 97  
             /** Unicode全角ラテン文字のコード範囲(!から~)であるか調べる */
 98  0
             if (c.compareTo(new Character((char)0xff01)) >= 0 && c.compareTo(new Character((char)0xff5e)) <= 0) {
 99  
                 /** 変換文字から0xfee0を減算して半角文字に変換 */
 100  0
                 Character x = new Character((char) (c.charValue() - (new Character((char)0xfee0)).charValue()));
 101  
 
 102  
                 /** 文字列としてセット */
 103  0
                 str = str + x.toString();
 104  0
             } else {
 105  
                 /** 全角ラテン文字以外はそのままセット */
 106  0
                 str = str + s.substring(i, i + 1);
 107  
             }
 108  
         }
 109  
 
 110  
         /** 変換後文字列を返す */
 111  0
         return str;
 112  
     }
 113  
     /**
 114  
     * 全角カタカナ→半角カタカナに変換する
 115  
     *
 116  
     * @param  対象文字列
 117  
     * @return 変換後文字列
 118  
     */
 119  
     public static String convZenkakuKatakanaToHankakuKatakana(String s) {
 120  0
         String str = "";
 121  
 
 122  
         /** パラメータの文字列を先頭から1文字づつ調べる */
 123  0
         for (int i = 0, j = 0; i < s.length(); i++) {
 124  
             /** 文字列から1文字取り出す */
 125  0
             Character c = new Character(s.substring(i, i + 1).charAt(0));
 126  
 
 127  
             /** Unicode全角カタカナのコード範囲か調べる */
 128  0
             if (c.compareTo(new Character((char)0x30a1)) >= 0 && c.compareTo(new Character((char)0x30fc)) <= 0) {
 129  
                 /** 半角全角変換テーブルから対応する半角カナを取得して戻り文字列へセット */
 130  0
                 for (j = 0; j < kanaHanZenTbl.length; j++) {
 131  0
                     if (s.substring(i).startsWith(kanaHanZenTbl[j][1])) {
 132  0
                         str = str + kanaHanZenTbl[j][0];
 133  0
                         break;
 134  
                     }
 135  
                 }
 136  
 
 137  
                 /** 半角全角変換テーブルにマッチするエントリがなければそのままセット */
 138  0
                 if (j >= kanaHanZenTbl.length) {
 139  0
                     str = str + s.substring(i, i + 1);
 140  
                 }
 141  0
             } else {
 142  
                 /** 全角カタカナ以外はそのままセット */
 143  0
                 str = str + s.substring(i, i + 1);
 144  
             }
 145  
         }
 146  
 
 147  
         /** 変換後文字列を返す */
 148  0
         return str;
 149  
     }
 150  
     /**
 151  
      * 引数の文字列(UTF-8)を、Shift_JISにエンコードする。
 152  
      * @param value 変換対象の文字列
 153  
      * @return エンコードされた文字列
 154  
      */
 155  
     public static String utf8ToSjis(String value)  {
 156  
         try {
 157  
             /* Sjisにすると文字化けするUnicodeにも対応する。*/
 158  0
             if(value != null) {
 159  0
                 StringBuffer sb = new StringBuffer();
 160  0
                 for(char c: value.toCharArray()) {
 161  0
                     sb.append(unicodeToSjis(Character.toString(c)));
 162  
                 }
 163  0
                 value = sb.toString();
 164  
             }
 165  0
             boolean[] boolAry = new boolean[value.length()];
 166  0
             byte[] srcStream = value.getBytes("UTF-8");
 167  0
             value = convert(new String(srcStream, "UTF-8"), "UTF-8", "SJIS");
 168  0
             boolAry = getQuePos(boolAry,value);
 169  0
             byte[] destStream = value.getBytes("SJIS");
 170  0
             value = new String(destStream, "SJIS");
 171  0
             value = convertGeta(value,boolAry);
 172  0
             return value;
 173  0
         } catch (UnsupportedEncodingException e) {
 174  0
             throw new RuntimeException(e);
 175  
         }
 176  
     }
 177  
     /**
 178  
     * 文字列中の「?」の位置を取得する。
 179  
     *
 180  
     * @param value 変換対象の文字列
 181  
     * @return boolAry 文字列中の「?」の位置
 182  
     */
 183  
     private static boolean[] getQuePos(boolean[] boolAry, String value) {
 184  0
         for (int i = 0; i < value.length(); i++) {
 185  0
             if (value.substring(i, i + 1).equals("?")) {
 186  0
                 boolAry[i] = true;
 187  0
             } else {
 188  0
                 boolAry[i] = false;
 189  
             }
 190  
         }
 191  0
         return boolAry;
 192  
     }
 193  
     /**
 194  
      * 文字化け「?」を代用文字「〓」に変換する。
 195  
      *
 196  
      * @param value 変換対象の文字列
 197  
      * @param bAry 変換する文字位置
 198  
      * @return newVal 変換後の文字列
 199  
      */
 200  
     private static String convertGeta(String value, boolean[] bAry) {
 201  0
         String newVal = "";
 202  0
         String c = "";
 203  0
         for (int i = 0; i < value.length(); i++) {
 204  0
             c = value.substring(i, i + 1);
 205  0
             if (bAry[i] == false) {
 206  0
                 if (c.equals("?")) {
 207  0
                     c = "〓";
 208  
                 }
 209  
             }
 210  0
             newVal = newVal + c;
 211  
         }
 212  0
         return newVal;
 213  
     }
 214  
     /**
 215  
      * 引数の文字列を、エンコードする。
 216  
      *
 217  
      * @param value 変換対象の文字列
 218  
      * @param src 変換前の文字コード
 219  
      * @param dest 変換後の文字コード
 220  
      * @return エンコードされた文字列
 221  
      */
 222  
     private static String convert(String value, String src, String dest) {
 223  0
         Map<String, String> conversion = createConversionMap(src, dest);
 224  
         char oldChar;
 225  
         char newChar;
 226  
         String key;
 227  0
         for (Iterator<String> itr = conversion.keySet().iterator(); itr.hasNext();) {
 228  0
             key = itr.next();
 229  0
             oldChar = toChar(key);
 230  0
             newChar = toChar(conversion.get(key));
 231  0
             value = value.replace(oldChar, newChar);
 232  
         }
 233  0
         return value;
 234  
     }
 235  
     /**
 236  
      * エンコード情報を作成する
 237  
      *
 238  
      * @param src 変換前の文字コード
 239  
      * @param dest 変換後の文字コード
 240  
      * @return エンコードされた文字列
 241  
      */
 242  
     private static Map<String, String> createConversionMap(String src, String dest) {
 243  0
         Map<String, String> conversion = new HashMap<String, String>();
 244  0
         if ((src.equals("UTF-8")) && (dest.equals("SJIS"))) {
 245  
             // -(全角マイナス)
 246  0
             conversion.put("U+FF0D", "U+2212");
 247  
             // ~(全角チルダ)
 248  0
             conversion.put("U+FF5E", "U+301C");
 249  
             // ¢(セント)
 250  0
             conversion.put("U+FFE0", "U+00A2");
 251  
             // £(ポンド)
 252  0
             conversion.put("U+FFE1", "U+00A3");
 253  
             // ¬(ノット)
 254  0
             conversion.put("U+FFE2", "U+00AC");
 255  
             // ―(全角マイナスより少し幅のある文字)
 256  0
             conversion.put("U+2015", "U+2014");
 257  
             // ∥(半角パイプが2つ並んだような文字)
 258  0
             conversion.put("U+2225", "U+2016");
 259  
 
 260  0
         } else if ((src.equals("SJIS")) && (dest.equals("UTF-8"))) {
 261  
             // -(全角マイナス)
 262  0
             conversion.put("U+2212", "U+FF0D");
 263  
             // ~(全角チルダ)
 264  0
             conversion.put("U+301C", "U+FF5E");
 265  
             // ¢(セント)
 266  0
             conversion.put("U+00A2", "U+FFE0");
 267  
             // £(ポンド)
 268  0
             conversion.put("U+00A3", "U+FFE1");
 269  
             // ¬(ノット)
 270  0
             conversion.put("U+00AC", "U+FFE2");
 271  
             // ―(全角マイナスより少し幅のある文字)
 272  0
             conversion.put("U+2014", "U+2015");
 273  
             // ∥(半角パイプが2つ並んだような文字)
 274  0
             conversion.put("U+2016", "U+2225");
 275  
 
 276  0
         } else {
 277  0
             throw new RuntimeException("この文字コードはサポートしていません。\n・src=" + src + ",dest=" + dest);
 278  
         }
 279  0
         return conversion;
 280  
     }
 281  
 
 282  
     /**
 283  
     * 16進表記の文字を取得する。
 284  
     *
 285  
     * @param value 変換対象の文字列
 286  
     * @return 16進表記の文字
 287  
     */
 288  
     private static char toChar(String value) {
 289  0
         return (char) Integer.parseInt(value.trim().substring("U+".length()), 16);
 290  
     }
 291  
     
 292  
     
 293  
     /** Sjisにすると文字化けするUnicodeにも対応する。*/
 294  
     public static String unicodeToSjis(String value) {
 295  0
         if(value == null || value.length() != 1) {
 296  0
             return value;
 297  
         }
 298  
         char decodeStr;
 299  
 
 300  0
         int code = (int)value.charAt(0);
 301  0
         String hex = Integer.toHexString(code);
 302  0
         hex = "u" + hex.toUpperCase();
 303  
 
 304  0
         if (hex.equals("u3299")==true) { decodeStr = Character.valueOf('\u79D8');} //㊙(?)→秘(秘)
 305  0
         else if (hex.equals("u4EFD")==true) { decodeStr = Character.valueOf('\u5F6C');} //份(?)→彬(彬)
 306  0
         else if (hex.equals("u4FE0")==true) { decodeStr = Character.valueOf('\u4FA0');} //俠(?)→侠(侠)
 307  0
         else if (hex.equals("u4FE0")==true) { decodeStr = Character.valueOf('\u4FA0');} //俠(?)→侠(侠)
 308  0
         else if (hex.equals("u501C")==true) { decodeStr = Character.valueOf('\u4FF6');} //倜(?)→俶(俶)
 309  0
         else if (hex.equals("u502E")==true) { decodeStr = Character.valueOf('\u88F8');} //倮(?)→裸(裸)
 310  0
         else if (hex.equals("u5040")==true) { decodeStr = Character.valueOf('\u82F1');} //偀(?)→英(英)
 311  0
         else if (hex.equals("u5042")==true) { decodeStr = Character.valueOf('\u524D');} //偂(?)→前(前)
 312  0
         else if (hex.equals("u5070")==true) { decodeStr = Character.valueOf('\u5951');} //偰(?)→契(契)
 313  0
         else if (hex.equals("u510B")==true) { decodeStr = Character.valueOf('\u62C5');} //儋(?)→担(担)
 314  0
         else if (hex.equals("u519D")==true) { decodeStr = Character.valueOf('\u5B9C');} //冝(?)→宜(宜)
 315  0
         else if (hex.equals("u51EE")==true) { decodeStr = Character.valueOf('\u98A8');} //凮(?)→風(風)
 316  0
         else if (hex.equals("u525D")==true) { decodeStr = Character.valueOf('\u5265');} //剝(?)→剥(剥)
 317  0
         else if (hex.equals("u525D")==true) { decodeStr = Character.valueOf('\u5265');} //剝(?)→剥(剥)
 318  0
         else if (hex.equals("u52C8")==true) { decodeStr = Character.valueOf('\u52C7');} //勈(?)→勇(勇)
 319  0
         else if (hex.equals("u5393")==true) { decodeStr = Character.valueOf('\u5D16');} //厓(?)→崖(崖)
 320  0
         else if (hex.equals("u5500")==true) { decodeStr = Character.valueOf('\u8A98');} //唀(?)→誘(誘)
 321  0
         else if (hex.equals("u5511")==true) { decodeStr = Character.valueOf('\u566C');} //唑(?)→噬(噬)
 322  0
         else if (hex.equals("u555E")==true) { decodeStr = Character.valueOf('\u5516');} //啞(?)→唖(唖)
 323  0
         else if (hex.equals("u555E")==true) { decodeStr = Character.valueOf('\u5516');} //啞(?)→唖(唖)
 324  0
         else if (hex.equals("u5649")==true) { decodeStr = Character.valueOf('\u5556');} //噉(?)→啖(啖)
 325  0
         else if (hex.equals("u5653")==true) { decodeStr = Character.valueOf('\u5618');} //噓(?)→嘘(嘘)
 326  0
         else if (hex.equals("u5653")==true) { decodeStr = Character.valueOf('\u5618');} //噓(?)→嘘(嘘)
 327  0
         else if (hex.equals("u5699")==true) { decodeStr = Character.valueOf('\u565B');} //嚙(?)→噛(噛)
 328  0
         else if (hex.equals("u5699")==true) { decodeStr = Character.valueOf('\u565B');} //嚙(?)→噛(噛)
 329  0
         else if (hex.equals("u569E")==true) { decodeStr = Character.valueOf('\u54F2');} //嚞(?)→哲(哲)
 330  0
         else if (hex.equals("u56CA")==true) { decodeStr = Character.valueOf('\u56A2');} //囊(?)→嚢(嚢)
 331  0
         else if (hex.equals("u56CA")==true) { decodeStr = Character.valueOf('\u56A2');} //囊(?)→嚢(嚢)
 332  0
         else if (hex.equals("u5723")==true) { decodeStr = Character.valueOf('\u8056');} //圣(?)→聖(聖)
 333  0
         else if (hex.equals("u57C8")==true) { decodeStr = Character.valueOf('\u5CFB');} //埈(?)→峻(峻)
 334  0
         else if (hex.equals("u5861")==true) { decodeStr = Character.valueOf('\u586B');} //塡(?)→填(填)
 335  0
         else if (hex.equals("u5861")==true) { decodeStr = Character.valueOf('\u586B');} //塡(?)→填(填)
 336  0
         else if (hex.equals("u5AF0")==true) { decodeStr = Character.valueOf('\u5AE9');} //嫰(?)→嫩(嫩)
 337  0
         else if (hex.equals("u5C1E")==true) { decodeStr = Character.valueOf('\u71CE');} //尞(?)→燎(燎)
 338  0
         else if (hex.equals("u5C5B")==true) { decodeStr = Character.valueOf('\u5C4F');} //屛(?)→屏(屏)
 339  0
         else if (hex.equals("u5C5B")==true) { decodeStr = Character.valueOf('\u5C4F');} //屛(?)→屏(屏)
 340  0
         else if (hex.equals("u5C62")==true) { decodeStr = Character.valueOf('\u5C61');} //屢(?)→屡(屡)
 341  0
         else if (hex.equals("u5C62")==true) { decodeStr = Character.valueOf('\u5C61');} //屢(?)→屡(屡)
 342  0
         else if (hex.equals("u5C88")==true) { decodeStr = Character.valueOf('\u8C3A');} //岈(?)→谺(谺)
 343  0
         else if (hex.equals("u5CBA")==true) { decodeStr = Character.valueOf('\u5DBA');} //岺(?)→嶺(嶺)
 344  0
         else if (hex.equals("u5FB0")==true) { decodeStr = Character.valueOf('\u5F81');} //徰(?)→征(征)
 345  0
         else if (hex.equals("u61BC")==true) { decodeStr = Character.valueOf('\u656C');} //憼(?)→敬(敬)
 346  0
         else if (hex.equals("u6414")==true) { decodeStr = Character.valueOf('\u63BB');} //搔(?)→掻(掻)
 347  0
         else if (hex.equals("u6414")==true) { decodeStr = Character.valueOf('\u63BB');} //搔(?)→掻(掻)
 348  0
         else if (hex.equals("u6451")==true) { decodeStr = Character.valueOf('\u63B4');} //摑(?)→掴(掴)
 349  0
         else if (hex.equals("u6451")==true) { decodeStr = Character.valueOf('\u63B4');} //摑(?)→掴(掴)
 350  0
         else if (hex.equals("u64E5")==true) { decodeStr = Character.valueOf('\u652C');} //擥(?)→攬(攬)
 351  0
         else if (hex.equals("u6522")==true) { decodeStr = Character.valueOf('\u6505');} //攢(?)→攅(攅)
 352  0
         else if (hex.equals("u6522")==true) { decodeStr = Character.valueOf('\u6505');} //攢(?)→攅(攅)
 353  0
         else if (hex.equals("u658A")==true) { decodeStr = Character.valueOf('\u6589');} //斊(?)→斉(斉)
 354  0
         else if (hex.equals("u6609")==true) { decodeStr = Character.valueOf('\u70B3');} //昉(?)→炳(炳)
 355  0
         else if (hex.equals("u6630")==true) { decodeStr = Character.valueOf('\u662F');} //昰(?)→是(是)
 356  0
         else if (hex.equals("u663B")==true) { decodeStr = Character.valueOf('\u6602');} //昻(?)→昂(昂)
 357  0
         else if (hex.equals("u663B")==true) { decodeStr = Character.valueOf('\u6602');} //昻(?)→昂(昂)
 358  0
         else if (hex.equals("u6665")==true) { decodeStr = Character.valueOf('\u7696');} //晥(?)→皖(皖)
 359  0
         else if (hex.equals("u66FA")==true) { decodeStr = Character.valueOf('\u66F9');} //曺(?)→曹(曹)
 360  0
         else if (hex.equals("u6702")==true) { decodeStr = Character.valueOf('\u52D7');} //朂(?)→勗(勗)
 361  0
         else if (hex.equals("u67FA")==true) { decodeStr = Character.valueOf('\u67B4');} //柺(?)→枴(枴)
 362  0
         else if (hex.equals("u67FA")==true) { decodeStr = Character.valueOf('\u67B4');} //柺(?)→枴(枴)
 363  0
         else if (hex.equals("u6805")==true) { decodeStr = Character.valueOf('\u67F5');} //栅(?)→柵(柵)
 364  0
         else if (hex.equals("u6805")==true) { decodeStr = Character.valueOf('\u67F5');} //栅(?)→柵(柵)
 365  0
         else if (hex.equals("u68A5")==true) { decodeStr = Character.valueOf('\u677E');} //梥(?)→松(松)
 366  0
         else if (hex.equals("u6A03")==true) { decodeStr = Character.valueOf('\u6994');} //樃(?)→榔(榔)
 367  0
         else if (hex.equals("u6A03")==true) { decodeStr = Character.valueOf('\u6994');} //樃(?)→榔(榔)
 368  0
         else if (hex.equals("u6A45")==true) { decodeStr = Character.valueOf('\u6A21');} //橅(?)→模(模)
 369  0
         else if (hex.equals("u6B56")==true) { decodeStr = Character.valueOf('\u559C');} //歖(?)→喜(喜)
 370  0
         else if (hex.equals("u6BF1")==true) { decodeStr = Character.valueOf('\u97A0');} //毱(?)→鞠(鞠)
 371  0
         else if (hex.equals("u6D82")==true) { decodeStr = Character.valueOf('\u5857');} //涂(?)→塗(塗)
 372  0
         else if (hex.equals("u6F51")==true) { decodeStr = Character.valueOf('\u6E8C');} //潑(?)→溌(溌)
 373  0
         else if (hex.equals("u6F51")==true) { decodeStr = Character.valueOf('\u6E8C');} //潑(?)→溌(溌)
 374  0
         else if (hex.equals("u7006")==true) { decodeStr = Character.valueOf('\u6D9C');} //瀆(?)→涜(涜)
 375  0
         else if (hex.equals("u7006")==true) { decodeStr = Character.valueOf('\u6D9C');} //瀆(?)→涜(涜)
 376  0
         else if (hex.equals("u705E")==true) { decodeStr = Character.valueOf('\u8987');} //灞(?)→覇(覇)
 377  0
         else if (hex.equals("u7130")==true) { decodeStr = Character.valueOf('\u7114');} //焰(?)→焔(焔)
 378  0
         else if (hex.equals("u7130")==true) { decodeStr = Character.valueOf('\u7114');} //焰(?)→焔(焔)
 379  0
         else if (hex.equals("u7147")==true) { decodeStr = Character.valueOf('\u6689');} //煇(?)→暉(暉)
 380  0
         else if (hex.equals("u7411")==true) { decodeStr = Character.valueOf('\u7463');} //琑(?)→瑣(瑣)
 381  0
         else if (hex.equals("u7431")==true) { decodeStr = Character.valueOf('\u5F6B');} //琱(?)→彫(彫)
 382  0
         else if (hex.equals("u7626")==true) { decodeStr = Character.valueOf('\u75E9');} //瘦(?)→痩(痩)
 383  0
         else if (hex.equals("u7626")==true) { decodeStr = Character.valueOf('\u75E9');} //瘦(?)→痩(痩)
 384  0
         else if (hex.equals("u76A6")==true) { decodeStr = Character.valueOf('\u768E');} //皦(?)→皎(皎)
 385  0
         else if (hex.equals("u7900")==true) { decodeStr = Character.valueOf('\u6F97');} //礀(?)→澗(澗)
 386  0
         else if (hex.equals("u79B1")==true) { decodeStr = Character.valueOf('\u7977');} //禱(?)→祷(祷)
 387  0
         else if (hex.equals("u79B1")==true) { decodeStr = Character.valueOf('\u7977');} //禱(?)→祷(祷)
 388  0
         else if (hex.equals("u7C1E")==true) { decodeStr = Character.valueOf('\u7BAA');} //簞(?)→箪(箪)
 389  0
         else if (hex.equals("u7C1E")==true) { decodeStr = Character.valueOf('\u7BAA');} //簞(?)→箪(箪)
 390  0
         else if (hex.equals("u7CB7")==true) { decodeStr = Character.valueOf('\u9EB9');} //粷(?)→麹(麹)
 391  0
         else if (hex.equals("u7E61")==true) { decodeStr = Character.valueOf('\u7E4D');} //繡(?)→繍(繍)
 392  0
         else if (hex.equals("u7E61")==true) { decodeStr = Character.valueOf('\u7E4D');} //繡(?)→繍(繍)
 393  0
         else if (hex.equals("u7E6B")==true) { decodeStr = Character.valueOf('\u7E4B');} //繫(?)→繋(繋)
 394  0
         else if (hex.equals("u7E6B")==true) { decodeStr = Character.valueOf('\u7E4B');} //繫(?)→繋(繋)
 395  0
         else if (hex.equals("u80DC")==true) { decodeStr = Character.valueOf('\u52DD');} //胜(?)→勝(勝)
 396  0
         else if (hex.equals("u8330")==true) { decodeStr = Character.valueOf('\u8438');} //茰(?)→萸(萸)
 397  0
         else if (hex.equals("u8346")==true) { decodeStr = Character.valueOf('\u834A');} //荆(?)→荊(荊)
 398  0
         else if (hex.equals("u8346")==true) { decodeStr = Character.valueOf('\u834A');} //荆(?)→荊(荊)
 399  0
         else if (hex.equals("u840A")==true) { decodeStr = Character.valueOf('\u83B1');} //萊(?)→莱(莱)
 400  0
         else if (hex.equals("u840A")==true) { decodeStr = Character.valueOf('\u83B1');} //萊(?)→莱(莱)
 401  0
         else if (hex.equals("u8493")==true) { decodeStr = Character.valueOf('\u84F4');} //蒓(?)→蓴(蓴)
 402  0
         else if (hex.equals("u8523")==true) { decodeStr = Character.valueOf('\u848B');} //蔣(?)→蒋(蒋)
 403  0
         else if (hex.equals("u8523")==true) { decodeStr = Character.valueOf('\u848B');} //蔣(?)→蒋(蒋)
 404  0
         else if (hex.equals("u8610")==true) { decodeStr = Character.valueOf('\u8431');} //蘐(?)→萱(萱)
 405  0
         else if (hex.equals("u8612")==true) { decodeStr = Character.valueOf('\u8429');} //蘒(?)→萩(萩)
 406  0
         else if (hex.equals("u87EC")==true) { decodeStr = Character.valueOf('\u8749');} //蟬(?)→蝉(蝉)
 407  0
         else if (hex.equals("u87EC")==true) { decodeStr = Character.valueOf('\u8749');} //蟬(?)→蝉(蝉)
 408  0
         else if (hex.equals("u881F")==true) { decodeStr = Character.valueOf('\u874B');} //蠟(?)→蝋(蝋)
 409  0
         else if (hex.equals("u881F")==true) { decodeStr = Character.valueOf('\u874B');} //蠟(?)→蝋(蝋)
 410  0
         else if (hex.equals("u88F5")==true) { decodeStr = Character.valueOf('\u88F4');} //裵(?)→裴(裴)
 411  0
         else if (hex.equals("u8989")==true) { decodeStr = Character.valueOf('\u7F88');} //覉(?)→羈(羈)
 412  0
         else if (hex.equals("u8990")==true) { decodeStr = Character.valueOf('\u899A');} //覐(?)→覚(覚)
 413  0
         else if (hex.equals("u8A37")==true) { decodeStr = Character.valueOf('\u4F38');} //訷(?)→伸(伸)
 414  0
         else if (hex.equals("u8EC0")==true) { decodeStr = Character.valueOf('\u8EAF');} //軀(?)→躯(躯)
 415  0
         else if (hex.equals("u8EC0")==true) { decodeStr = Character.valueOf('\u8EAF');} //軀(?)→躯(躯)
 416  0
         else if (hex.equals("u91AC")==true) { decodeStr = Character.valueOf('\u91A4');} //醬(?)→醤(醤)
 417  0
         else if (hex.equals("u91AC")==true) { decodeStr = Character.valueOf('\u91A4');} //醬(?)→醤(醤)
 418  0
         else if (hex.equals("u91B1")==true) { decodeStr = Character.valueOf('\u9197');} //醱(?)→醗(醗)
 419  0
         else if (hex.equals("u91B1")==true) { decodeStr = Character.valueOf('\u9197');} //醱(?)→醗(醗)
 420  0
         else if (hex.equals("u969D")==true) { decodeStr = Character.valueOf('\u5CF6');} //隝(?)→島(島)
 421  0
         else if (hex.equals("u974D")==true) { decodeStr = Character.valueOf('\u9DB4');} //靍(?)→鶴(鶴)
 422  0
         else if (hex.equals("u974E")==true) { decodeStr = Character.valueOf('\u9DB4');} //靎(?)→鶴(鶴)
 423  0
         else if (hex.equals("u974F")==true) { decodeStr = Character.valueOf('\u9DB4');} //靏(?)→鶴(鶴)
 424  0
         else if (hex.equals("u982B")==true) { decodeStr = Character.valueOf('\u4FEF');} //頫(?)→俯(俯)
 425  0
         else if (hex.equals("u9830")==true) { decodeStr = Character.valueOf('\u982C');} //頰(?)→頬(頬)
 426  0
         else if (hex.equals("u9830")==true) { decodeStr = Character.valueOf('\u982C');} //頰(?)→頬(頬)
 427  0
         else if (hex.equals("u985A")==true) { decodeStr = Character.valueOf('\u985B');} //顚(?)→顛(顛)
 428  0
         else if (hex.equals("u985A")==true) { decodeStr = Character.valueOf('\u985B');} //顚(?)→顛(顛)
 429  0
         else if (hex.equals("u9A52")==true) { decodeStr = Character.valueOf('\u9A28');} //驒(?)→騨(騨)
 430  0
         else if (hex.equals("u9A52")==true) { decodeStr = Character.valueOf('\u9A28');} //驒(?)→騨(騨)
 431  0
         else if (hex.equals("u9DD7")==true) { decodeStr = Character.valueOf('\u9D0E');} //鷗(?)→鴎(鴎)
 432  0
         else if (hex.equals("u9DD7")==true) { decodeStr = Character.valueOf('\u9D0E');} //鷗(?)→鴎(鴎)
 433  0
         else if (hex.equals("u9E7C")==true) { decodeStr = Character.valueOf('\u9E78');} //鹼(?)→鹸(鹸)
 434  0
         else if (hex.equals("u9E7C")==true) { decodeStr = Character.valueOf('\u9E78');} //鹼(?)→鹸(鹸)
 435  0
         else if (hex.equals("u9EB4")==true) { decodeStr = Character.valueOf('\u9EB9');} //麴(?)→麹(麹)
 436  0
         else if (hex.equals("u9EB4")==true) { decodeStr = Character.valueOf('\u9EB9');} //麴(?)→麹(麹)
 437  0
         else if (hex.equals("u9EB5")==true) { decodeStr = Character.valueOf('\u9EBA');} //麵(?)→麺(麺)
 438  0
         else if (hex.equals("u9EB5")==true) { decodeStr = Character.valueOf('\u9EBA');} //麵(?)→麺(麺)
 439  0
         else if (hex.equals("u9FA2")==true) { decodeStr = Character.valueOf('\u548C');} //龢(?)→和(和)
 440  
         else {
 441  0
             decodeStr = value.charAt(0);
 442  
         }
 443  0
         return Character.toString(decodeStr);
 444  
     }
 445  
 }