Arabic converted to question marks “????” on JSP form

By Ali Hammad Baig on 11:01 PM

Filed Under: , ,

Its been pain to solve the windows-1256 character set (Arabic) problem. Many times when my JSP form is submitted all the Arabic in fields turn to “?????” and the original Arabic text is lost.

I have one line solution for this. But I can not assure you that it will work in all scenarios. But it may prove helpful.

If you are showing Arabic on your form, then you may already be doing this

    response.setContentType("text/html;charset=windows-1256");
response.setHeader("Content-Language" , "ar");

You can place the following line at the top of the page which could solve your problems.

    request.setCharacterEncoding("windows-1256");

Try it and if you have any questions, leave comments.

0 comments for this post

Post a Comment

Blog Widget by LinkWithin