I want to implement a little Dropdown that will show Items that I searched for in a folder.
So, the problem is that I'm German and we have characters like Ä, Ö, Ü etc.
These characters are shown in a strange way. For example, the char Ö is "%c3". Also, spaces are shown as "%20".
Is there a simple way to change them without the string.Replace
function?
My code:
try
{
string dirPath = (Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
"\\Arma 3 - Other Profiles");
List<string> dirs = new List<string>(Directory.EnumerateDirectories(dirPath));
foreach (var dir in dirs)
{
HttpUtility.UrlDecode(dir);
MessageBox.Show(dir);
comboBox1.Items.Add(dir.ToString());
}
}
catch (UnauthorizedAccessException UAEx)
{
Console.WriteLine(UAEx.Message);
}
catch (PathTooLongException PathEx)
{
Console.WriteLine(PathEx.Message);
}