You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohammad Al-Bedaiwi <mo...@austin.rr.com> on 2002/10/03 04:56:40 UTC

Internationalization.

Hello all.

A strange behavior when tomcat service JSPs that contain Arabic text.

 

I am running a small app which does a DB search. The DB data is in
Arabic, 

I can access the DB from my action (using struts), get the information
that I want to return to the user, stick it on the request and return to
the JSP for view.

 

My jsp has both hardcoded Arabic text and scriptlets to show the results
from the search. When the JSP displays, IE does NOT automatically set
the encoding to Arabic.  The user must manually select Encoding
->Arabic(Windows) .. and boom, it works . All the Arabic text appears
fine including the results of the search. This is just annoying, b/c
every time the user must select encoding -> Arabic (Windows).  

I noticed that when I saved the source of this window locally to
Something.html, and double click it, boom, it automatically shows in
Arabic.  

 

*** It seems like if the JSP is serviced by tomcat, IE fails to
recognize the encoding in the <head> <meta http-equiv="Content-Type"
content="text/html; charset=windows-1256"> </head> tag, and that is why
the Auto detection fails. ***

 

 

I tried to add the following line to the JSP

<%@ page contentType="text/html; charset=windows-1256" %>

 

However, the result was even more strange: The hardcoded Arabic text in
the jsp appeared OK. (in Arabic), IE automatically set the encoding to
Arabic.  HOWEVER, the search text that was returned from the action
shows as ????????? (question marks)

It seems that the JSP interpreter attempted to interpret the Arabic text
again??? Or something like that, and it encoded it again??? I am not
sure!!

 

 

Any ideas on:

1. what does this line do to the JSP <%@ page contentType="text/html;
charset=windows-1256" %> compiler?

2. any solution that I can try to get my Arabic text appear correctly?

 

Thanks a  lot!

Mohammad