Exemplo n.º 1
0
  /**
   * 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;
    }
  }
Exemplo n.º 2
0
 public static boolean isNullEncoding(String s) {
   try {
     String s1 = com.dragonflow.Utils.I18N.nullEncoding();
     byte abyte0[] = s1 != null && s1.length() != 0 ? s.getBytes(s1) : s.getBytes();
   } catch (Exception exception) {
     return false;
   }
   return true;
 }
Exemplo n.º 3
0
 public static String toDefaultEncoding(String s) {
   if (!isI18N) {
     return s;
   } else {
     com.dragonflow.Utils.I18N.test(s, 1);
     String s1 =
         com.dragonflow.Utils.I18N.UnicodeToString(s, com.dragonflow.Utils.I18N.nullEncoding());
     return com.dragonflow.Utils.I18N.StringToUnicode(s1, "");
   }
 }
Exemplo n.º 4
0
  /**
   * 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;
    }
  }
Exemplo n.º 5
0
 public static String escapeString(String s, String s1) {
   return com.dragonflow.Utils.TextUtils.escapeHTML(
       com.dragonflow.Utils.I18N.StringToUnicode(
           com.dragonflow.Utils.I18N.UnicodeToString(s, com.dragonflow.Utils.I18N.nullEncoding()),
           s1));
 }