Hi,
before you gain the parameters in a servlet you should set their
encoding (by default they are latin1).
The best way is to use a filter like this:
public class ArabicEncodingFilter implements Filter {
public void init(FilterConfig filterConfig) throws ServletException {
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws IOException
<http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&bntl=1>,
ServletException {
if (request.getCharacterEncoding() == null) {
request.setCharacterEncoding("windows-1256");
}
chain.doFilter(request, response);
}
public void destroy() {
}
}
And configure it in web.xml, too.
I hope this could help.
Martin
ps: Be aware of the console encoding. I don't know, could be problem
with the encoding in it, too. Just try to output the string in new html
page.
pps: Maybe you could try this too <%@ page language="java"
contentType="text/html; charset=windows-1256" pageEncoding="windows-1256"%>
Ahmed Atif wrote:
hi all,
i have a problem with my web application, when i enter an arabic text in the
text fields and trying to save it in the database or print it into the
command it appears with some strange encoding some like this " اØÙ?د "
and i'm using
the meta tag
<meta http-equiv="Content-Language" content="ar-eg">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
also
<[EMAIL PROTECTED] pageEncoding="windows-1256"%>
but nothing happened
please if any one know how to solve this prob.
thanks
regards,
Ahmed
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]