FTP command "NLST" gives me "?" instead of "æ", "ø" or "å"
-
I've created my own ftp client, and I retrive the files on a folder by using the "NLST" command. This gives me an ArrayList of the filenames in that folder. My problem is that the filenames contains "?" instead of "æ", "ø" or "å". I've set det Transfer Type = "TYPE A" (I've tryed "TYPE E" and "TYPE L", but I only get a return value that this is not implemented, and I don't know how to do this, or if it will solve my problem.) Does anyone know how I can fix this? Thanks in advanced Thomas
-
I've created my own ftp client, and I retrive the files on a folder by using the "NLST" command. This gives me an ArrayList of the filenames in that folder. My problem is that the filenames contains "?" instead of "æ", "ø" or "å". I've set det Transfer Type = "TYPE A" (I've tryed "TYPE E" and "TYPE L", but I only get a return value that this is not implemented, and I don't know how to do this, or if it will solve my problem.) Does anyone know how I can fix this? Thanks in advanced Thomas
The problem was in my stream reader
bytes = stream.Read(buffer, 0, buffer.Length); strMessage += Encoding.ASCII.GetString(buffer, 0, bytes);
replasing it withEncoding.Default.GetString(buffer, 0, bytes);
gave me the correct format. But my problem dosen't stop there, for now I wan't the FileSize of the file, this i do by:Byte[] cmdBytes = Encoding.Default.GetBytes(("SIZE Berlinerbolle bringebær.doc"+ "\r\n").ToCharArray()); stream.Write(cmdBytes, 0, cmdBytes.Length);
but then I get the "550 Berlinerbolle bringebær.doc: The system cannot find the file specified. ". I've tried different types of encoding but it all returns somewhat the same error. So now the quetsion is how do I sett the Encoding for an ftp site on a windows 2000 server run by IIS?