You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Arnab Chakravarty <ac...@sapient.com> on 2004/11/30 15:28:18 UTC

UTF-8 Encoding in Jsp

Hi all,

I need to make my all jsp files compatible with UTF-8 Encoding and even
though I am using the directives:

<%@ page pageEncoding="UTF-8"%>
<%@ page contentType = "text/html;charset=UTF-8"%>

in the jsp files, cannot make it work.

Using tomcat version 5. Is there any config changes I need to make for
the UTF-8 Encoding to work.

Please help.

Thanks in advance,
Arnab

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


Re: UTF-8 Encoding in Jsp

Posted by Andoni <an...@eurokom.ie>.
Hello,

First and foremost I would say: be absolutely sure that it is the JSP's
fault. I hope you are not getting some data from a database and trying to
show it? Be sure that your editor is saving the JSP in UTF-8 format.

Add the flag:
-Dfile.encoding=UTF-8
to the CATALINA_OPTS environment variable in your catalina.bat (or
equivalent) startup file.

and use:
req.setCharacterEncoding("UTF-8");
to set the encoding on the request.

This may help:

http://marc.theaimsgroup.com/?l=tomcat-user&m=105524550416364&w=2

Though you can ignore the method wich is used to set the encoding as the
above line does the same job in servlets.

Andoni.



----- Original Message ----- 
From: "Arnab Chakravarty" <ac...@sapient.com>
Newsgroups: gmane.comp.jakarta.tomcat.user
Sent: Tuesday, November 30, 2004 2:28 PM
Subject: UTF-8 Encoding in Jsp


Hi all,

I need to make my all jsp files compatible with UTF-8 Encoding and even
though I am using the directives:

<%@ page pageEncoding="UTF-8"%>
<%@ page contentType = "text/html;charset=UTF-8"%>

in the jsp files, cannot make it work.

Using tomcat version 5. Is there any config changes I need to make for
the UTF-8 Encoding to work.

Please help.

Thanks in advance,
Arnab


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


RE: UTF-8 Encoding in Jsp

Posted by Mariano <ml...@sescam.org>.
You should use too:

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

and this scriptlet:

	request.setCharacterEncoding("UTF-8");

at the beginning.

I hope this help you

-----Mensaje original-----
De: Arnab Chakravarty [mailto:achakravarty@sapient.com]
Enviado el: martes, 30 de noviembre de 2004 15:28
Para: Tomcat Users List
Asunto: UTF-8 Encoding in Jsp


Hi all,

I need to make my all jsp files compatible with UTF-8 Encoding and even
though I am using the directives:

<%@ page pageEncoding="UTF-8"%>
<%@ page contentType = "text/html;charset=UTF-8"%>

in the jsp files, cannot make it work.

Using tomcat version 5. Is there any config changes I need to make for
the UTF-8 Encoding to work.

Please help.

Thanks in advance,
Arnab

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