开发者

Malformed Farsi Or Arabic characters on Stripes

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.


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:

<%@page pageEncoding="UTF-8" %>

As a bonus, it'll also instruct the server to write out those characters in the given encoding.

See also:

  • Unicode - How to get the characters right? - JSP/Servlet response


You might want to take a look at the Stripes Localization information.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜