Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

program returns text on windows, hex on linux  RSS feed

 
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 (http://stackoverflow.com/questions/9333852/java-downloading-word-doc-contents-show-up-as-hex), but did not get an answer. Since then I've broken the problem down a little but I still haven't solved it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!