-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

German Starz,

On 12/18/11 7:26 AM, starz10de wrote:
> I a login page (it has utf-8) I checked this also manually; after
> login is successful a jsp page will be called to enter the query.
> This jsp page use iso encoding although inside it utf-8 is
> defined.

Remember that the encoding of the response and the encoding of the
page are separate issues. If the page has been saved to the disk as
ISO-8859-1, the response can still be sent using UTF-8.

> I couldn’t understand from why the browser automatically user iso
> encoding although I force it to use utf-8.
> 
> Here how I do:
> 
> <meta http-equiv='Content-Type' content='text/html;
> charset=UTF-8'>

You should also be using:

<%@page pageEncoding="UTF-8" ... %>

or

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

I usually rig the JSP to grab the content type and charset directly
from the response, instead of hard-coding them. That way, the will
always be in sync:

<meta http-equiv="Content-Type" content="$response.contentType" />

(You /are/ using XHTML, right?)

Note that your response must have a definite character encoding set,
otherwise the default default default will be ISO-8859-1 and might not
be displayed in your Content-Type META tag.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7vvp4ACgkQ9CaO5/Lv0PCxlgCgpf72A/Zr+XAd2q5UwdhFUF4v
M4MAoIeIqcXZevsN16jeyfi6IlMjF+NP
=D1A2
-----END PGP SIGNATURE-----

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

Reply via email to