windows eventlog: fix unicode characters in file names. closes #1023

This commit is contained in:
Hylke Bons 2012-11-09 22:13:12 +00:00
parent ee12e3adbd
commit add50ff1af

View file

@ -19,6 +19,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
@ -563,6 +564,11 @@ namespace SparkleShare {
private string FormatBreadCrumbs (string path_root, string path)
{
byte [] path_root_bytes = Encoding.Default.GetBytes (path_root);
byte [] path_bytes = Encoding.Default.GetBytes (path);
path_root = Encoding.UTF8.GetString (path_root_bytes);
path = Encoding.UTF8.GetString (path_bytes);
path_root = path_root.Replace ("/", Path.DirectorySeparatorChar.ToString ());
path = path.Replace ("/", Path.DirectorySeparatorChar.ToString ());
string new_path_root = path_root;