在 Java 应用程序中,我得到 JSON(来自 Google Maps),\x26
其中包含我想要转换为其原始字符的字符&
。据我所知,这是一个 UTF-8 符号,但我不完全确定。在源 JSON 中可以出现各种编码字符(例如\x3c/div\x3e
)。我怎样才能解码它们?
我试过:
String json = "\\x3c/div\\x3e";
byte [] b = json.getBytes("UTF-8");
json = new String(b,"UTF-8");
没运气。有任何想法吗?