Do other ways (like in a NT command prompt FTP session) accept the national characters?
Bob
Main Topics
Browse All TopicsHi!
I'm writing an FTP client in VB.NET for educational purpose, so using an third party FTP client is not an option.
I'm having problem with sending the CWD command (Change Working Directory) to the FTP Server running IIS 6.
It works as expected with non-national characters, but when i try to change to a directory with national characters in the name, it doesn't work!
The server replies with code 550, file not found.
I've tried sending the command and directory name encoded in both UTF-7 and UTF-8, without success.
How do i make this work with national characters?
Any help appreciated!
Regards
Kristoffer
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The part of the code where I send the command to the FTP Server looks like this:
Dim command As String = "CWD Images" & vbNewLine
Dim buffer() As Byte = System.Text.Encoding.ASCII
Dim stream As NetworkStream = TcpClient.GetStream()
stream.Write(buffer, 0, buffer.Length)
The FTP Server is on my local network and is running IIS 6 on Windows Server 2003.
The language version of Windows Server is swedish, and i'm having problem with changing to a directory with a swedish character in the directory name. It works with IE and other FTP Clients, bot not with the code above and not with the FTP command prompt utility.
In the response from the server (550 File not found), the national character is replaced with a question mark.
/Kristoffer
I managed to get the right characters back in the server response by using UTF7 encoding when I convert the byte array to a string.
No question marks anymore.
But it still says "550 File not found" when i send a CWD command encoded in UTF7.
Enclosing the directory name in double quotes doesn't make any difference.
If I send a LIST command, the directory list returned looks OK.
The national characters are displayed correctly.
/Kristoffer
Turning the server into UTF8 mode (RFC-2640 compliant) would be using the
OPTS UTF8 ON
command. The server should return 220 UTF8 OPTS ON (or so) if supported (can be queried using FEAT). Afterwards, all textual data (dir/file names, dir listings, etc.) will be UTF8.
If that does not work, I'd suggest to use Encoding.Default - which is usually the ISO-8859-1 in Europe. I know that there is a risk that this does not match the server encoding, but the chances are good that it will work with FTP servers using English charsets as well as with geographically close FTP servers using the same (or a similar) encoding.
Business Accounts
Answer for Membership
by: andrewharrisPosted on 2004-10-29 at 01:05:31ID: 12442115
DOes the IIS Server have the applicable character set installed?
Andrew