コード例 #1
0
ファイル: I18N.java プロジェクト: SiteView/ECC8.13
  /**
   * CAUTION: Decompiled by hand.
   *
   * @param s
   * @param s1
   * @return
   */
  public static String UnicodeToString(String s, String s1) {
    try {
      if (s == null) return "";
      if (!isI18N(s)) /* change by dingbing.xu from isI18N */ {
        return s;
      }

      if (s1 == com.dragonflow.Utils.I18N.nullEncoding()) {
        com.dragonflow.Utils.I18N.test(s, 1);
      } else if (s1.length() == 0) {
        com.dragonflow.Utils.I18N.test(s, 0);
      }
      String s2;
      byte abyte0[] = s1 != null && s1.length() != 0 ? s.getBytes(s1) : s.getBytes();
      char ac[] = new char[abyte0.length];
      for (int i = 0; i < abyte0.length; i++) {
        ac[i] = (char) (abyte0[i] & 0xff);
      }

      s2 = new String(ac);
      com.dragonflow.Utils.I18N.test(s2, 2);
      return s2;
    } catch (Exception exception) {
      if (s1 != null && s1.length() > 0) {
        com.dragonflow.Log.LogManager.log(
            "Error", "I18N: Bad Encoding(" + s1 + ") " + exception.getMessage());
        com.dragonflow.Utils.TextUtils.debugPrint(
            "I18N: Bad Encoding(" + s1 + ") " + exception.getMessage());
        exception.printStackTrace();
      }
      return s;
    }
  }
コード例 #2
0
ファイル: I18N.java プロジェクト: SiteView/ECC8.13
  /**
   * CAUTION: Decompiled by hand.
   *
   * @param abyte0
   * @return
   */
  public static String byteString(byte abyte0[]) {
    if (!isI18N) {
      return new String(abyte0);
    }
    try {
      String s;
      char ac[] = new char[abyte0.length];
      for (int i = 0; i < abyte0.length; i++) {
        ac[i] = (char) (abyte0[i] & 0xff);
      }

      s = new String(ac);
      return s;
    } catch (Exception exception) {
      com.dragonflow.Log.LogManager.log("Error", "I18N: Cannot Encode " + exception.getMessage());
      com.dragonflow.Utils.TextUtils.debugPrint("I18N: Cannot Encode " + exception.getMessage());
      exception.printStackTrace();
      return "";
    }
  }
コード例 #3
0
ファイル: I18N.java プロジェクト: SiteView/ECC8.13
  /**
   * CAUTION: Decompiled by hand.
   *
   * @param s
   * @param s1
   * @return
   */
  public static String StringToUnicode(String s, String s1) {
    if (s == null || s.length() == 0) {
      return "";
    }

    if (!isI18N(s)) /*change By dingbing.xu*/ {
      return s;
    }
    String s2 = "";
    com.dragonflow.Utils.I18N.test(s, 2);
    String s3;

    try {
      byte abyte0[] = new byte[s.length()];
      for (int i = 0; i < s.length(); i++) {
        abyte0[i] = (byte) (s.charAt(i) & 0xff);
      }

      s3 = s1 != null && s1.length() != 0 ? new String(abyte0, s1) : new String(abyte0);
      if (s1 == com.dragonflow.Utils.I18N.nullEncoding()) {
        com.dragonflow.Utils.I18N.test(s3, 1);
      } else if (s1.length() == 0) {
        com.dragonflow.Utils.I18N.test(s3, 0);
      }
      return s3;
    } catch (Exception exception) {
      if (s1 != null && s1.length() > 0) {
        com.dragonflow.Log.LogManager.log(
            "Error", "I18N: Bad Encoding(" + s1 + ") " + exception.getMessage());
        com.dragonflow.Utils.TextUtils.debugPrint(
            "I18N: Bad Encoding(" + s1 + ") " + exception.getMessage());
        exception.printStackTrace();
      }
      return s;
    }
  }