Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: problem with arabic in multilanguage jsp

Sherif M. Riad

2004-01-14

Replies:

I ve been dealing with arabic on jsp pages for long time
And I found this to be the bottom line

<%@(protected)"%>
<%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@(protected)]
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:
> <%@(protected)"%>
> 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@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.