I have the following function to download files from our server. Some customers name their file with Chinese characters and then I get the following error in Wc_DownloadFileCompleted: "The remote server returned an error: (404) Not Found.". I have tried HttpUtility.UrlEncode to encode the URL but that gives me an error on the Uri constructor or if I just encode the last part I get the same 404 error.
This is the URL giving me the problems:
http://example.com/Uploads/-463941/480630/1802+201830030210+孟万青.CNC.cloudfile
I have double-checked that the file is at that location and with the same filename.
private void DownloadCloudFile(string url)
{
WebClient wc = new WebClient();
wc.DownloadFileCompleted += Wc_DownloadFileCompleted;
string tmpfile = Path.GetTempFileName();
wc.DownloadFileAsync(new Uri(url), tmpfile, tmpfile);
}