条纹上格式错误的波斯语或阿拉伯语字符
我正在使用 Stripes 框架开发 Web 应用程序。我希望能够在网页中使用波斯语或阿拉伯语字符。 我
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
在layout_main.jsp的标签中使用了它,但它对我不起作用。
我还查看了 http://confluence.atlassian.com /display/DOC/Configuring+Tomcat%27s+URI+encoding 但仍然不起作用。
当我使用
时会出现此问题,这意味着如果我不使用条纹布局,则
<%@taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld"%>
使用波斯语字符没有问题。有没有办法使用条纹布局by stripes.tld 并且波斯语字符没有问题?
任何帮助表示赞赏。
I am using Stripes framework to develop a web application.I want to be able to use Farsi or Arabic characters in web pages.
I used
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
inside <head>
tag of layout_main.jsp but it didn't work for me.
Also I had a look at http://confluence.atlassian.com/display/DOC/Configuring+Tomcat%27s+URI+encoding but still didn't work.
When I use <s:layout-render>
this problem occurs,meaning that If I don't use stripes layout by
<%@taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld"%>
there is no problem to use Farsi characters.Is there any way to use stripes layout by stripes.tld and not having problem in Farsi characters?
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只要通过 HTTP 提供页面,使用
标记就完全没有效果。您需要在 HTTP 响应标头中设置字符集。将以下内容添加到 JSP 顶部即可实现此目的:
作为奖励,它还将指示服务器以给定编码写出这些字符。
另请参阅:
Using that
<meta>
tag has totally no effect whenever the page is served over HTTP. You need to set the charset in the HTTP response header instead. Add the following to top of your JSP to achieve that:As a bonus, it'll also instruct the server to write out those characters in the given encoding.
See also:
您可能需要查看Stripes 本地化信息。
You might want to take a look at the Stripes Localization information.