]> git.saurik.com Git - wxWidgets.git/commitdiff
fix handling of '#' in file names (patch 1740328)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Jun 2007 00:05:01 +0000 (00:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Jun 2007 00:05:01 +0000 (00:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filesys.cpp

index 7e6044e4c255a17e614a7807b0c1c163daea889b..db370fd11a9ccb4536a7aeb6448cf0ebb0330aab 100644 (file)
@@ -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;