我正在使用URL解码器来解码字符串:
import java.net.URLDecoder;
URLDecoder.decode("%u6EDA%u52A8%u8F74%u627F", StandardCharsets.UTF_8.name());
这导致坠机
Exception in thread "main" java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "u6"
at java.net.URLDecoder.decode(URLDecoder.java:194)
at Playground$.delayedEndpoint$Playground$1(Playground.scala:45)
at Playground$delayedInit$body.apply(Playground.scala:10)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:392)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76)
at Playground$.main(Playground.scala:10)
at Playground.main(Playground.scala)
它似乎是和不允许在字符串中。我试图阅读这些符号是什么,但我一直没有成功。我在数据集中名为“页面标题字段”的字段中找到了该字符串。所以我怀疑它们是编码符号,我只是不知道哪种编码。有谁知道这些符号是什么,我应该使用哪种编码来成功解码它们?%u6%u8
qq_笑_17
慕妹3146593
子衿沉夜
随时随地看视频慕课网APP
相关分类