tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sherif M. Riad" <she...@thewayout.net>
Subject RE: problem with arabic in multilanguage jsp
Date Wed, 14 Jan 2004 14:44:03 GMT
I ve been dealing with arabic on jsp pages for long time
And I found this to be the bottom line

<%@page  contentType="text/html;charset=UTF-8"%>
<%request.setCharacterEncoding("UTF-8");%>

and then in the html part of the page

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

also your development environment should be set to encode characters in
UTF-8 and your database to store characters in the same characterset

I guess you can replace UTF-8 with windows-1256 in all cases

This worked very good with me, the characters are real Arabic characters
and they are sorted according to the Arabic alphabet sorting and also
they can be found if you queried them.

Hope this works with you too

Best regards

Sherif M. Riad

 

MIS Manager

Egyptian Exporters Association (ExpoLink),

90 Road #105.,

El Maadi,

Cairo 11728,

Egypt.

 

Tel: +202 527 1010

Fax:+202  527 1015

WebSite: http://www.expolink.org


-----Original Message-----
From: Christopher Schultz [mailto:christopher.d.schultz@comcast.net] 
Sent: Wednesday, January 14, 2004 4:16 PM
To: Tomcat Users List
Subject: Re: problem with arabic in multilanguage jsp

Thomas,

> we are running a tomcat instance that uses common jsps for all
languages. If
> no encoding is set in the http-header tomcat 4.1.29 sets iso-8859-1 by
> default. Arabic users must then configure their browsers themselves
> (unacceptable).
> 
> (1)
> If I set the encoding in the jsp like this:
> <%@page contentType="text/html;charset=windows-1256"%>
> everything is fine. But as I told, our jsps are multilingual.
> 
> (2)
> If I set the encoding in  the jsp like this:
> <%
> 	response.setContentType("text/html;charset=windows-1256");
> %>
> the results are just question marks. The same thing happens if the
arabic
> text is not hardcoded in the jsp but comes from a varable.

Have you tried using:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1256"
/>

Does this trigger the browser to display the text properly? If so, you 
might consider adding this for some languages (like Arabic).

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message