Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] always about encoding (may be OT)

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Luca Passani <passani AT eunet.no>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] always about encoding (may be OT)
  • Date: Mon, 30 May 2005 18:41:26 +0200

I hope this is not OT. I have just found out that the same servlet, with the same exact libraries sending the same document
to the same exact browser, produces different results as far as the encoding is concerned. And this is totally puzzling:

The only differences between the two configurations do not explain this:

- Java 1.4, Sun Solaris, Tomcat 5

- Java 1.5 (but everything compiled for 1.4 compatibility), tomcat 4, WindowsXP

Here is what I get when I use the first configuration (http://wap.nrk.no/, but I could use any non US-ASCII page):

"F?lg kampene direkte"

here is the second (i.e. development environment on windows):

"Følg kampene direkte"

Same exact JAR files. Ideas?

I use jakarta commons HttpClient to acquire the content (according to the javadocs, this respects the encoding)

myHTML = getmethod.getResponseBodyAsString();
encoding = getmethod.getRequestCharSet();

and:

response.setContentType("text/html;charset="+encoding);
PrintWriter out = response.getWriter(); out.println(this.toPrettyXML(doc,encoding));

to send it to the browser again

Thanks

Luca





Archive powered by MHonArc 2.6.24.

Top of Page