Skip to Content.
Sympa Menu

xom-interest - Re: [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: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Luca Passani <passani AT eunet.no>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] always about encoding (may be OT)
  • Date: Mon, 30 May 2005 09:55:05 -0700

Might be a tomcat 4/5 configuration issue, might be any of many things. I don't recall the exact issue, but some time ago there was a great deal of confusion between different major and minor tomcat versions wrt. encodings and default encodings. Also consider the weird or nonsensical things that can happen when the HTTP encoding (or HTTP default encoding) does not match the XML encoding statet in the XML header, or the default XML encoding.

Try to progressively narrow the diffs between your setups down until you find the exact reason.

Wolfgang.

On May 30, 2005, at 9:41 AM, Luca Passani wrote:


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

_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest








Archive powered by MHonArc 2.6.24.

Top of Page