From: Vadim Zeitlin Date: Thu, 21 Jun 2007 00:05:01 +0000 (+0000) Subject: fix handling of '#' in file names (patch 1740328) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d81f6eac731b532053c67aa4290dcdfe5a30fd88 fix handling of '#' in file names (patch 1740328) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 7e6044e4c2..db370fd11a 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -27,6 +27,7 @@ #include "wx/mimetype.h" #include "wx/filename.h" #include "wx/tokenzr.h" +#include "wx/uri.h" #include "wx/private/fileback.h" // ---------------------------------------------------------------------------- @@ -613,8 +614,7 @@ wxFileName wxFileSystem::URLToFileName(const wxString& url) path = path.Mid(2); #endif - path.Replace(wxT("%25"), wxT("%")); - path.Replace(wxT("%3A"), wxT(":")); + path = wxURI::Unescape(path); #ifdef __WXMSW__ // file urls either start with a forward slash (local harddisk), @@ -661,6 +661,7 @@ wxString wxFileSystem::FileNameToURL(const wxFileName& filename) #endif url.Replace(g_nativePathString, g_unixPathString); + url.Replace(wxT("#"), wxT("%23")); url.Replace(wxT("%"), wxT("%25")); url.Replace(wxT(":"), wxT("%3A")); url = wxT("file:") + url;