Handle gaim filenames better which are manually escaped RCS file: /cvs/gnome/beagle/Util ImLog.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ImLog.cs 2005/05/02 22:47:31 1.16 +++ ImLog.cs 2005/06/27 14:44:15 1.17 @@ -76,7 +76,7 @@ { } public Uri Uri { - get { return UriFu.UriStringToUri (this.LogFile); } + get { return UriFu.PathToFileUri (this.LogFile); } } public string EllipsizedSnippet { RCS file: /cvs/gnome/beagle/Util ImLog.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- ImLog.cs 2005/06/27 14:44:15 1.17 +++ ImLog.cs 2005/06/30 09:38:06 1.18 @@ -402,8 +402,9 @@ log.Timestamp = file.LastWriteTime; - log.SpeakingTo = file.Directory.Name; - log.Identity = file.Directory.Parent.Name; + // Gaim likes to represent many characters in hex-escaped %xx form + log.SpeakingTo = StringFu.HexUnescape (file.Directory.Name); + log.Identity = StringFu.HexUnescape (file.Directory.Parent.Name); array.Add (log); } RCS file: /cvs/gnome/beagle/Util StringFu.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- StringFu.cs 2005/05/28 23:00:20 1.26 +++ StringFu.cs 2005/06/30 09:38:06 1.27 @@ -293,6 +293,20 @@ return builder.ToString (); } + // Translate all %xx codes into real characters + static public string HexUnescape (string str) + { + int i = 0, pos = 0; + while ((i = str.IndexOf ('%', pos)) != -1) { + pos = i; + char unescaped = UriFu.HexUnescape (str, ref pos); + str = str.Remove (i, 3); + str = str.Insert (i, new String(unescaped, 1)); + pos -= 2; + } + return str; + } + static public string PathToQuotedFileUri (string path) { path = Path.GetFullPath (path);