Hello Group
I have a fileserver with several files. Some of the filenames contain danish
characters (e.g. 'æ', 'ø', 'å'). Now I'm trying to make a web application in
C# that presents links to some of the files. I would like the user to be
able to open the file by clicking on the link.
I have the file:
"G:\My Documents\Anders Kåre Olsen.txt"
If I use this path as a link in MSIE, it automatically converts it to:
file:///G:/My%20Documents/Anders%20K%E5re%20Olsen.txt
However Firefox does not do this conversion automatically, and I have a
requirement that says that the page must work in MSIE and Firefox. If I copy
the URL from MSIE to Firefox, it works fine, so I just need to do the
conversion programmatically (in this case, I need to convert ' ' to '%20'
and 'å' to '%E5').
I have tried to use the HttpUtility.UrlPathEncode, but this method
apparantly have problems with the danish characters like 'å'. It converts
last path of the above path to:
/My%20Documents/Anders%20K%c3%a5re%20Olsen.txt
And not even MSIE likes the conversion of 'å' to %c3%a5.
Basically, is there an automatic way to convert the characters to something
that both browsers like. And why does C# convert 'å' to %c3%a5? Is it
because of unicode?
Regards
Anders Olsen