From add50ff1afc379ed519443bdce10859964a24930 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 9 Nov 2012 22:13:12 +0000 Subject: [PATCH] windows eventlog: fix unicode characters in file names. closes #1023 --- SparkleShare/SparkleEventLogController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index acf43e46..4e2bad62 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -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;