code: public static String encodeUnicode(final String gbString) {
          char[] utfBytes = gbString.toCharArray();
          String unicodeBytes = "";
          for (int byteIndex = 0; byteIndex < utfBytes.length; byteIndex++) {
              String hexB = Integer.toHexString(utfBytes[byteIndex]);   //转换为16进制整型字符串
              if (hexB.length() <= 2) {
                  hexB = "00" + hexB;
              }
              unicodeBytes = unicodeBytes + "\\u" + hexB;
          }
          System.out.println("unicodeBytes is: " + unicodeBytes);
          return unicodeBytes;
      }
docs: 字符转Unicode
  @param gbString
  @return