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?