Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.5k views
in Java FTP by
First off, thank you for that easy to use ftp libary. Sadly, I have a strange problem. My Java Programm runs on a AIX and USS (which is a UNIX under a HOST) both with the IBM JDK. On the AIX I have no problems at all but on the USS everything works except for the encoding. Let me give a example:
I can connect from the USS to every FTP Server an even browse , but when I get a directory listing or a text file (which is ASCII), the econding is something I can not read.
If in the Directory are two files called: angemeldet.sh and blik. ftp.dir() will give me

2 Answers

0 votes
by
After trying a lot of stuff (and learning about encoding conversion :-) ), i come to the conclusion that there is a bug in the IBM Virtual Machine on the USS. The transformation of encodings is probably not implementet. Once you got EBCDIC encoding you can not conevrt it bach to ASCII on the IBM VM on USS.
So the only workaround is to modify the InputStreamReader and give it a fixed encoding. Off Course yau have to modify the ASCII get/put Methods analog to this if you wish to use them:

Class: FTPClient
Method: public String[] dir(String dirname, boolean full)

Code:
...
LineNumberReader in =new LineNumberReader(
new InputStreamReader(data.getInputStream(),"Cp850"));
...

I know its a ugly workaround, but thats the only way to get it run under a USS.

Greetings Codon
0 votes
by (161k points)
Thanks for the info.

I know its a ugly workaround, but thats the only way to get it run under a USS.

Greetings Codon

Categories

...