import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.Charset;
public class Main {
public static void main(String[] args) throws UnsupportedEncodingException {
String encodedText = "\u7f8e\u56fd\u62dc\u6c83\u80a1\u4efd\u6709\u9650\u516c\u53f8"; // Unicode编码的文本
String decodedText = URLDecoder.decode(encodedText, "UTF-8"); // 使用UTF-8字符集进行解码
// String decodedText = new String(encodedText.getBytes(), Charset.forName("UTF-8"));
System.out.println("解码后的文本为:" + decodedText);
//解码后的文本为:美国拜沃股份有限公司
}
}
java解码Unicode编码
![](https://img-home.csdnimg.cn/images/20240711042549.png)