X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d81f6eac731b532053c67aa4290dcdfe5a30fd88..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/common/filesys.cpp?ds=inline diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index db370fd11a..71dc13788b 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -661,8 +661,18 @@ wxString wxFileSystem::FileNameToURL(const wxFileName& filename) #endif url.Replace(g_nativePathString, g_unixPathString); + url.Replace(wxT("%"), wxT("%25")); // '%'s must be replaced first! url.Replace(wxT("#"), wxT("%23")); - url.Replace(wxT("%"), wxT("%25")); + + // notice that all colons *must* be encoded in the paths used by + // wxFileSystem even though this makes URLs produced by this method + // unusable with IE under Windows as it requires "file:///c:/foo.bar" and + // doesn't accept "file:///c%3a/foo.bar" -- but then we never made any + // guarantees about general suitability of the strings returned by this + // method, they must work with wxFileSystem only and not encoding the colon + // breaks handling of "http://wherever/whatever.zip#zip:filename.ext" URLs + // so we really can't do this without heavy changes to the parsing code + // here, in particular in GetRightLocation() url.Replace(wxT(":"), wxT("%3A")); url = wxT("file:") + url; return url;