Re: Encoding in Tomcat 6

2007-05-22 Thread hkml
uzi wrote: > i liked this article regarding encoding: > http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/index.html Thanks for the hint. Looks nice. Cheers, Heinz - To start a new topic, e-mail: users@tomc

Re: Encoding in Tomcat 6

2007-05-22 Thread uzi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i liked this article regarding encoding: http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/index.html i think, it sais all one have to know... (at least in the context of web apps) uzi [EMAIL PROTECTED] wrote: > Georg Sauer-Limbach

Re: Encoding in Tomcat 6

2007-05-22 Thread hkml
Georg Sauer-Limbach wrote: >> I do not think it is very obvious, that the response class is writing >> the characters using the platform's default encoding in this case > > Yes. And this is true for many, many places in the > Java library. Always watch out if you see some > String being processed

Re: Encoding in Tomcat 6

2007-05-22 Thread Georg Sauer-Limbach
[EMAIL PROTECTED] wrote: Georg Sauer-Limbach wrote: the question is: How do you create the output of the servlet, that is, with which Writer or OutputStream. yes you're right: I simply used the output stream. Never do this if you want to output character data. (Unless you do the encoding your

Re: Encoding in Tomcat 6

2007-05-21 Thread hkml
Georg Sauer-Limbach wrote: the question is: How do you create the output of the servlet, that is, with which Writer or OutputStream. yes you're right: I simply used the output stream. But if you just obtain the output byte stream of the servlet, ie by calling OutputStream outputStream = res

Re: Encoding in Tomcat 6

2007-05-21 Thread hkml
Markus Schönhaber wrote: ... ServletOutputStream is "suitable for writing binary data in the response" as the docs say. If you want to transmit textual data, use HttpServletResponse#getWriter() (see my question above). yes, this really is a point, Georg's answer already pointed me to the right d

Re: Encoding in Tomcat 6

2007-05-21 Thread Markus Schönhaber
[EMAIL PROTECTED] wrote: > Markus Schönhaber wrote: > > Works fine for me. > Well, that is really a surprise for me. I tried this in 3 different > operating systems and it was consequently wrong. That, in turn, doesn't surprise me, since... > > You do call response#setContentType before respo

Re: Encoding in Tomcat 6

2007-05-21 Thread Georg Sauer-Limbach
Hi, the question is: How do you create the output of the servlet, that is, with which Writer or OutputStream. If you do this: public void doGet( HttpServletRequest request, HttpServletResponse response ) throws IOException { response.setCharacterEncoding( "UTF-8" ); Writ

Re: Encoding in Tomcat 6

2007-05-21 Thread hkml
Markus Schönhaber wrote: > Works fine for me. Well, that is really a surprise for me. I tried this in 3 different operating systems and it was consequently wrong. > You do call response#setContentType before response#getWriter, don't you? > There's no filter changing things? Well, the code is m

RE: Encoding in Tomcat 6

2007-05-21 Thread Fargusson.Alan
Is it valid to say "charset=UTF-8"? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 7:51 AM To: users@tomcat.apache.org Subject: Encoding in Tomcat 6 Hi all, I noticed some encoding problems inside servlets, when switching f

Re: Encoding in Tomcat 6

2007-05-21 Thread Markus Schönhaber
[EMAIL PROTECTED] wrote: > Scenario: > An own servlet (that is: a class derived from HttpServlet) is creating > very simple HTML output, containing (beside the necessary HTML tags > , etc.) just some German special characters (ä ö ü). > > The java source code is UTF-8, the response instance is

Re: Encoding in Tomcat 6

2007-05-21 Thread hkml
[EMAIL PROTECTED] wrote: > , etc.) just some German special characters (ä ö ü). sorry for that encoding problem, it should read ä ö ü. I first sent the message using a different mail address. Then I got a response from the list server, that I'm not allowed to send messages to this list and afte

Encoding in Tomcat 6

2007-05-21 Thread hkml
Hi all, I noticed some encoding problems inside servlets, when switching from Tomcat 5.5.20 to Tomcat 6.0.10. I looked for it in the mailing lists, but didn't find something appropriate. Scenario: An own servlet (that is: a class derived from HttpServlet) is creating very simple HTML output, con