Thanks for your help. > 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.
Unfortunately I get the same '?' in place of those characters even by replacing it. > Alternatively, why not use ™, ©, and ® instead? The problem is that the data entry guys will copy/paste these symbols from the webpages and they will go just as the come. When viewing from database the JSP has to recognize the characters and display them accordingly. Even if i use a filter for replacing these characters it won't help because the JSPWriter would have placed the ? already in the stream being sent to the browser. The same thing works for Servlets but not for JSPs. I read that the writer in Servlets uses the content-type set in request to determine the encoding while JSPWriter uses the system settings of the Locale or something. Nasty problem isn't it? > HTH, > > Dan. Affan > > > -----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]
