tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Re: RE: Character Encodig/ CodePage Problem
Date Fri, 03 Dec 2004 14:02:27 GMT

Don't create the PrintWriter yourself, get it from response.getWriter.  Let the container
worry about its encoding.

Yoav Shapira

>-----Original Message-----
>From: []
>Sent: Friday, December 03, 2004 3:20 AM
>Subject: Re: Re: RE: Character Encodig/ CodePage Problem
>Sorry my mail from yesterday must be lost somewhere .
>Well,  after further testing i figured that the encoding problem does only
>occur when you are sending the HTML generated Code through the java.
>io.PrintWriter. In my case the Printwriter ignores the
>httpservletResponse.setContentType("text/html; charset=iso-8859-1l");.
>Therefore it is irrelevant where the data comes from, which is send to the
>Example which does have the problem:
>PrintWriter out = new PrintWriter(httpservletResponse.getOutputStream(),
>out.println("...Some Data");
>Example where it works:
>StringBuffer buf = new StringBuffer ();
>buf.append("...Some Data");
>httpservletResponse.setContentType("text/html; charset=iso-8859-1");
>Well, I found a workaround but that soes not really make me happy.
>The Question is which encoding settings are relevant for the class
> But this is rather a Questions concerning a different
>Mailing-List.  But if somebody does have clue, do not hesitate to tell me.
>Thanks for your help!
>> -----Ursprüngliche Nachricht-----
>> Von: Allistair Crossley []
>> Gesendet: Donnerstag, 2. Dezember 2004 13:28
>> An: Tomcat Users List
>> Betreff: RE: Character Encodig/ CodePage Problem
>> where are you pulling the actual character data from? a database or is in
>> *in* the jsp?
>>the HTML  code is generated by a servlet and the Character encoding has
>been set with the follwing code-snippet:
>>res.setContentType("text/html; charset=iso-8859-1"); Even the Browser says
>it  is the encoding.
>>The result after testing various Codepages :
>>charset=utf-8 the only difference concering the Umlaut is that the browser
>cannot transform them properly, shown with an "?" instead of the wanted
>>charset=iso-8859-1 does not have the transforming problem, just that
>transforming result is rather strange. (Ä = Ž; Ö = (tm) ; I hope this viewed
>>Therefore it seems that the problem is not related to the code, rather the
>>Any hints where I can change the character setting for the tomcat?
>>Bye Saffina
>>>do your jsps have these directives at the very top (although they ought
>to be these values by default, certainly in servlet 2.4 spec - but I see
>you are using Tomcat 4, so maybe it was different then).
>>><%@ page contentType="text/html;charset=ISO-8859-1" %>
>>><%@ page pageEncoding="ISO-8859-1" %>
>>>-----Original Message-----
>>>From: S.Esters []
>>>Sent: Wed 01/12/2004 20:08
>>>Subject: Character Encodig/ CodePage Problem
>>>	Hi,
>>>	the problem concerns the displaying of german Umlaute such as äöü The
>OS is
>>>	NW65 out of the box with Apache 2.0.49 and tomcat 4.1.28, JVM
>>>	The german Umlaute in the servlet generated HTML-Code is not
>>>	properly even though the character-encoding in the Web-Browser is
>>>	iso-8859-1.
>>>	I assume that the problem is related to the TomCat Configuration or
>>>	combination of the OS, TomCat and Apache.
>>>	Is it possible that this is well known problem and where can I find a
>>>	solution for it?
>>>	Is it possible to determine the character-encoding for an application
>>>	the TomCat and where can it done?
>>>	The same servlet and request from a Unix Enviroment does work fine,
>>>	therefore the coding can not be wrong all the way!
>>>	Bye Soapy
>>>	---------------------------------------------------------------------
>>>	To unsubscribe, e-mail: tomcat-user-unsubscrib
>>>	For additional commands, e-mail:
>>>QAS Ltd.
>>>Developers of QuickAddress Software
>>><a href=""></a>
>>>Registered in England: No 2582055
>>>Registered in Australia: No 082 851 474
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message