tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Davidson <>
Subject Re: Unable to display UK Pound Sign
Date Mon, 12 May 2008 20:08:08 GMT
I had some more thoughts on this.  I'm curious how you manage to have
an encoding type mismatch.  In JSP's, encoding is set with the
"<%@page%>" or "<>" tags with "encodingType" or
"contentType" attributes.  In servlets, it's set with
javax.servlet.ServletResponse.setContentType(String) though that
needs to be called /before/ ServletResponse.getWriter() is called.

You can also set defaults in the web.xml for the app or Tomcat in the
"<page-encoding>" sub element of the "<jsp-property-group>" sub
element of the "<jsp-config>" element.

If you're getting the data out of a database, presumably, it's getting into
a Java String, which is then getting output as ISO-8859-1.  However,
your markup presumably is being identified to the browser in the
Content-Type HTTP header as as something else, most likely UTF-8.
You need to either fix your output to match your header or fix your
header to match your output.

I like the Live HTTP Headers extension for Firefox for examining
HTTP headers:

--Bill Davidson

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message