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

31Mar09

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.

Advertisements


No Responses Yet to “Arabic converted to question marks “????” on JSP form”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: