Hi friends pls some help my problems is the following
I have a ftp server running on linux and in my program I download files from the ftp server using class specified below.When I download the file content not all content is coming ok. For example I have a string with Ra�l����1234%#=?[a_@ and when I read content using my methods this part is retirved ok Ra and this one is retrived wrong ����� whith characteres very stranges.
I suppose that the problem is with the encoding, then all day I tried some settings in the class new InputStreamReader.First the encoding UTF-8 because I have created the file using this encoding. Something like this:
in = new InputStreamReader(new GZIPInputStream(localFtp.get(serverFile)),"UTF-8");
but does not work
After I realized that I use the statement localFtp.ascii(); declaring that the content will be downloaded in ascii encoding so I made this change :
in = new InputStreamReader(new GZIPInputStream(localFtp.get(serverFile)),"US-ASCII");
Surely, if you've downloaded a non-ASCII file using ASCII encoding, you've already broken it. So it doesn't matter what encoding you use for reading after downloading it - you may be unable to fix it, because information may have been lost/corrupted. Trying to use "US-ASCII" for reading is never going to give good values for non-ASCII characters.
Shouldn't you download the file in binary?
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.