Den 15/07/11 16.27, Federico Vela skrev:
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.
Java converts to 16-bit Unicode internally when reading in characters. The encoding used, depend on the configuration where AS/400 defaults to ISO-Latin-1 (think this being an AIX machine), and all java.io.File operations expect characters to be in ISO-Latin-1.

If you need the AS/400 to do character conversion on file system objects (including Unixy files under "/") you need to use jt400 and the IFSFile object.

If you need to create a file from scratch, use "touch -C 819 whatever.txt". You can then edit it and "cat >> whatever.txt" and it stays in code page 819 (which is ISO-Latin-1).


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.