X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/593177c566d3471189571641fb9db8efa27ed551..850df2d78866c3edcf848103b5dbc7e7fa1ee5fa:/src/common/filesys.cpp?ds=sidebyside diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 7e6044e4c2..038e55407f 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,7 +661,8 @@ wxString wxFileSystem::FileNameToURL(const wxFileName& filename) #endif url.Replace(g_nativePathString, g_unixPathString); - url.Replace(wxT("%"), wxT("%25")); + url.Replace(wxT("%"), wxT("%25")); // '%'s must be replaced first! + url.Replace(wxT("#"), wxT("%23")); url.Replace(wxT(":"), wxT("%3A")); url = wxT("file:") + url; return url;