tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Re: RE: Character Encodig/ CodePage Problem
Date Fri, 03 Dec 2004 08:19:46 GMT
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 Browser.

Example which does have the problem:
PrintWriter out = new PrintWriter(httpservletResponse.getOutputStream(), true);
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
>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 character.
>charset=iso-8859-1 does not have the transforming problem, just that transforming result
is rather strange. (Ä = Ž; Ö = ™ ; I hope this viewed properly)
>Therefore it seems that the problem is not related to the code, rather the plattform-settings.
>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 1.4.2_02.
>>	The german Umlaute in the servlet generated HTML-Code is not displayed
>>	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 the
>>	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 within
>>	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:

View raw message