You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ahmed Talaat <ai...@gmail.com> on 2006/05/12 08:20:06 UTC

Arabic Support on tomcat 5.0.28

Hi,
Any way to submit arabic chars through jsps?
I need to get the following code to work.. When i submit arabic 
characters using the this jsp, tomcat just replaces them with '????'.



<%@ page language="java" contentType="text/html; charset=cp1256"
    pageEncoding="cp1256"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=cp1256">
<title>Insert title here</title>
</head>
<body>
<%=request.getParameter("text")%>
<form action="index.jsp">
<input type="text" name="text">
<input type="submit">
</form>
</body>
</html>

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


Re: Arabic Support on tomcat 5.0.28

Posted by Ahmed Talaat <ai...@gmail.com>.
Thanx Rajeev,
that solves it
alse adding URIEncoding="UTF-8" parameter to the connector tag in 
server.xml file is good idea

Rajeev Jha wrote:
> This should not be a big issue.  Lets say we submit some arabic data 
> through a form and then re-display it
> To submit correct data
> 1) HTMl page should be
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> 2) when you receive the data , do a
> request.setContentEncoding() before getting string data from request
>
> To display
> 3) set the response content type
> res.setContentType("text/html;charset=UTF-8; pageEncoding=UTF-8");
> Make sure you have correct fonts installed
> And Browser view | encoding is set correctly
>
> btw why not use UTF-8 instead of cp1256 ?
>
> Thanks
>
> Rajeev.
>
> Ahmed Talaat wrote:
>
>> Hi,
>> Any way to submit arabic chars through jsps?
>> I need to get the following code to work.. When i submit arabic 
>> characters using the this jsp, tomcat just replaces them with '????'.
>>
>>
>>
>> <%@ page language="java" contentType="text/html; charset=cp1256"
>>    pageEncoding="cp1256"%>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>
>> <head>
>> <meta http-equiv="Content-Type" content="text/html; charset=cp1256">
>> <title>Insert title here</title>
>> </head>
>> <body>
>> <%=request.getParameter("text")%>
>> <form action="index.jsp">
>> <input type="text" name="text">
>> <input type="submit">
>> </form>
>> </body>
>> </html>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: Arabic Support on tomcat 5.0.28

Posted by Rajeev Jha <jh...@gmail.com>.
This should not be a big issue.  Lets say we submit some arabic data 
through a form and then re-display it
To submit correct data
1) HTMl page should be
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
2) when you receive the data , do a
request.setContentEncoding() before getting string data from request

To display
3) set the response content type
res.setContentType("text/html;charset=UTF-8; pageEncoding=UTF-8");
Make sure you have correct fonts installed
And Browser view | encoding is set correctly

btw why not use UTF-8 instead of cp1256 ?

Thanks

Rajeev.

Ahmed Talaat wrote:

> Hi,
> Any way to submit arabic chars through jsps?
> I need to get the following code to work.. When i submit arabic 
> characters using the this jsp, tomcat just replaces them with '????'.
>
>
>
> <%@ page language="java" contentType="text/html; charset=cp1256"
>    pageEncoding="cp1256"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=cp1256">
> <title>Insert title here</title>
> </head>
> <body>
> <%=request.getParameter("text")%>
> <form action="index.jsp">
> <input type="text" name="text">
> <input type="submit">
> </form>
> </body>
> </html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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