I think you have some things backwards there.
First of all when you process an ISO-8859 text file in Java, the bytes in it are converted to the corresponding Unicode characters. They are not converted to a UTF-8 encoding of those characters. So "converted to UTF-8" is incorrect and misleading. UTF-8 isn't involved.
As for your file on the System I, presumably its encoding is not ISO-8859-1 but your code assumes that it is. It's possible that the CCSID has something to do with this, especially since it's 65535. It's a bad idea to use that as your system CCSID for several reasons, so I do suggest that you change it. However it's also possible that your text file is EBCDIC rather than ASCII, although in most cases where I have done that I just get garbage and not encoding errors. What exactly is the CCSID of your file?
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Federico Vela
Sent: July 15, 2011 07:27
To: java400-l@xxxxxxxxxxxx
Subject: iSeries Character Encoding and Java
Hello,
I have a text file processing software built with Java 6 on linux and windows machines with DB2 LUW. I am testing it on an iSeries machine
(V6.1) with its instance of DB2.
When processing an (ISO-8859) text file (whose characters are presumably converted to UTF-8 upon reading it in Java), that processes successfully under linux and windows, I get a sun.io.MalformedInputException.
It seems this exception happens because an incoming character cannot be converted to UTF-8. However since the only thing that changes is the operating system to System i, I am guessing it has something to do with the System value of the CCSID which is currently set to 65535, or perhaps some kind of environment variable for the JVM.
Ok, thanks for reading this far.
My question is, in your opinion, might the CCSID value have anything to do with the problem I am experiencing?
Thanks!!!
--
Federico Vela
Java Software Manager
PaySett Corporation
fvela@xxxxxxxxxxx
+57 1 544 3564
DISCLAIMER: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Unless you have express written permission from PaySett Corporation you are not allowed to disseminate, distribute or copy this e-mail outside of the intended organization. If you are not the intended recipient/organization you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.