Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

program returns text on windows, hex on linux

Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope this is the right forum.

When I run the following code on my Windows Desktop, it returns a big bunch of XML (which is what I want). When I run it in Linux, I get a big bunch of hex (which I don't want). The XML is stored as a bytea in a postgresql 9.0.1 database. It is a result of a file upload. I understand that the charset used to encode the file must match the charset I give to the new String() constructor (correct?), but after I put acceptCharset="UTF-8" into my upload form (It is a seam application), the same thing still happens. So, I wrote the following stand-alone program to try and get the text out.
I've tried other charsets but they get the same results. Does anyone know why this is?

a few weeks ago, I asked about this on stackoverflow (, but did not get an answer. Since then I've broken the problem down a little but I still haven't solved it.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic