code: public static boolean isMessyCode(String strName) {
          Pattern p = Pattern.compile("\\s*|t*|r*|n*");
          Matcher m = p.matcher(strName);
          String after = m.replaceAll("");
          String temp = after.replaceAll("\\p{P}", "");
          char[] ch = temp.trim().toCharArray();
          float chLength = ch.length;
          float count = 0;
          for (int i = 0; i < ch.length; i++) {
              char c = ch[i];
              if (!Character.isLetterOrDigit(c)) {
                  if (!isChinese(c)) {
                      count = count + 1;
                  }
              }
          }
          float result = count / chLength;
          if (result > 0.4) {
              return true;
          } else {
              return false;
          }
   
      }
docs: 判断字符串是否是乱码
  
  @param strName 字符串
  @return 是否是乱码