Affan,

The encoding is set just fine. If I copy and paste your JSP, and run it
here, I get the following as the content type in the HTTP headers:

Content-Type: text/html; charset=UTF-8

You're seeing empty squares where you'd expect characters for a couple of
reasons:

The Unicode escape for trademark is \u2122, according to the HTML 4.01 spec.
The raw copyright characters in your document are in ISO-8859-1, not UTF-8.

If you replace \u0099 by \u2122, it works just fine.

Alternatively, why not use ™, ©, and ® instead?

HTH,

Dan.

> -----Original Message-----
> From: Affan Qureshi [mailto:[EMAIL PROTECTED]]
> Sent: 31 January 2003 11:38
> To: Tomcat Users List
> Subject: Setting UTF-8 Encoding
>
>
> I am having trouble setting the encoding to UTF-8 and hence my
> web pages are
> unable to render characters like the Trademark or Copyright symbols. In
> Tomcat's source at various places teh character encoding is
> hard-coded to be
> ISO-8859-1. I have tried to use the filter in the examples to set the
> encoding type but that did not help and I kept seeing questionamarks for
> those characters. I have also tried to modify the source and
> build again but
> that doesn't work either (I know I must be doing something wrong here.)
>
> Somehow tomcat doesn't allow me to change the character encoding to UTF-8.
> The same JSPs are looking fine on Weblogic and Resin without any
> configuration/modification to the server settings.
>
> Any ideas how can I fix this ugly problem in my app. The app is unusable
> without this.
>
> Thanks a lot.
>
> Affan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to