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:[EMAIL PROTECTED]
> 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:[EMAIL PROTECTED] 
>>Sent: Wed 01/12/2004 20:08 
>>To: [EMAIL PROTECTED] 
>>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
>
>[EMAIL PROTECTED]
>>      For additional commands, e-mail: [EMAIL PROTECTED]
>>      
>>      
>>
>>
>>
>><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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to