【发布时间】:2023-03-28 12:20:01
【问题描述】:
这是我的 Jsp 页面:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String msg="206_John_help i m in trouble,delhi,อินเดีย_30.64741430_76.817313799";
String result = java.net.URLEncoder.encode(msg, "UTF-8");
System.out.println("The msg is "+result);
String result1=java.net.URLDecoder.decode(result, "UTF-8");
System.out.println("The decoded msg is "+result1);
%>
</body>
</html>
输出是 206_John_help i m in trouble,delhi,???????_30.64741430_76.817313799
我总是得到 ??????而不是泰文字母。解码时如何获取泰语字母?
【问题讨论】:
-
尝试编写包含泰文字符的
hello.html,将其放在文件系统和tomcat下,然后尝试用浏览器打开它。在这种情况下你能正确看到泰语字符吗?
标签: java jsp tomcat utf-8 glassfish