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
This commit is contained in:
Vadim Zeitlin
2007-06-21 00:05:01 +00:00
parent d6a41cc7d5
commit d81f6eac73

View 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;