tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From est...@saffina.de
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");
httpservletResponse.setContentLength(buf.length());
httpservletResponse.getOutputStream().print(buf.toString());

Well, I found a workaround but that soes not really make me happy.
The Question is which encoding settings are relevant for the class java.io.PrintWriter. 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!
Soapy





> -----Ursprüngliche Nachricht-----
> Von: Allistair Crossley [mailto:Allistair.Crossley@QAS.com]
> 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?

>Hi,
>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 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" %>
>> 
>>Allistair.
>> 
>>-----Original Message----- 
>>From: S.Esters [mailto:esters@saffina.de] 
>>Sent: Wed 01/12/2004 20:08 
>>To: tomcat-user@jakarta.apache.org 
>>Cc: 
>>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
>
>e@jakarta.apache.org
>>	For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>	
>>	
>>
>>
>>
>><FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
>>-------------------------------------------------------
>>QAS Ltd.
>>Developers of QuickAddress Software
>><a href="http://www.qas.com">www.qas.com</a>
>>Registered in England: No 2582055
>>Registered in Australia: No 082 851 474
>>-------------------------------------------------------
>></FONT>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message