sevlet 中的 UTF-8 问题
当我尝试从 jsp 到 sevlet 获取参数 'Ђимими ESO11 Ђимими ' 时,该值的形式为 'تÙÙÙÙات ESO '。我在 servlet 代码中设置了以下内容
response.setContentType("text/html; charset=UTF-8");
response.setCharacterEncoding("UTF-8");
,并在 jsp 中进行了以下设置
<%@ page contentType="text/html; charset=UTF-8" %>
<%@page pageEncoding="UTF-8"%>
While i trying to getting parameter 'تقويمات ESO11 تقويمات 'from jsp to sevlet the value is of the form 'تÙÙÙÙات ESO '.I set following in servlet code
response.setContentType("text/html; charset=UTF-8");
response.setCharacterEncoding("UTF-8");
and in jsp following settings are made
<%@ page contentType="text/html; charset=UTF-8" %>
<%@page pageEncoding="UTF-8"%>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您通过 HTTP GET 发送此数据,您可能需要调整 URIEncoding 选项。如果您使用apache tomcat,则需要配置UTF-8。
请参阅 http://tomcat.apache.org/tomcat-5.5-doc /config/http.html
一个
server.xml
示例:如果这不是您的问题,可以在此处找到更详细的帖子:如何让 UTF-8 在 Java Web 应用程序中工作?
If you send this data via HTTP GET you need possibly to adjust the URIEncoding option. If you use apache tomcat you need to configure UTF-8.
see http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
a
server.xml
example:If this is not your problem a more detailed post can be found here: How to get UTF-8 working in Java webapps?