/**
     * 16进制的字符串转化为utf-8格式的字符串
     * @param s
     * @return
     */
    public static String toStringHex(String s) {
        byte[] baKeyword = new byte[s.length() / 2];
        for (int i = 0; i < baKeyword.length; i++) {
        try {
        baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(
        i * 2, i * 2 + 2), 16));
        } catch (Exception e) {
        e.printStackTrace();
        }
        }
        try {
        s = new String(baKeyword, "utf-8");// UTF-16le:Not
        } catch (Exception e1) {
        e1.printStackTrace();
        }
        return s;
    }

 

相关文章:

  • 2021-08-20
  • 2021-05-18
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-11-16
  • 2021-11-26
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案