revert not encoding the colons in FileNameToURL() under MSW (r51904, patch 1890922) as this completely broke wxFS URLs parsing; explain this in a comment in the trunk version
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -663,14 +663,17 @@ wxString wxFileSystem::FileNameToURL(const wxFileName& filename)
|
|||||||
url.Replace(g_nativePathString, g_unixPathString);
|
url.Replace(g_nativePathString, g_unixPathString);
|
||||||
url.Replace(wxT("%"), wxT("%25")); // '%'s must be replaced first!
|
url.Replace(wxT("%"), wxT("%25")); // '%'s must be replaced first!
|
||||||
url.Replace(wxT("#"), wxT("%23"));
|
url.Replace(wxT("#"), wxT("%23"));
|
||||||
#ifndef __WXMSW__
|
|
||||||
// even though encoding the colon is (AFAICS) the right thing to do, we
|
// notice that all colons *must* be encoded in the paths used by
|
||||||
// shouldn't do this under Windows because IE refuses to handle the
|
// wxFileSystem even though this makes URLs produced by this method
|
||||||
// resulting file:// URLs and Firefox and Opera (and probably all the other
|
// unusable with IE under Windows as it requires "file:///c:/foo.bar" and
|
||||||
// browsers as they need to be IE-compatible anyhow) open both the versions
|
// doesn't accept "file:///c%3a/foo.bar" -- but then we never made any
|
||||||
// with ':' and "%3A", so leave the colon alone to keep IE happy
|
// 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.Replace(wxT(":"), wxT("%3A"));
|
||||||
#endif // __WXMSW__
|
|
||||||
url = wxT("file:") + url;
|
url = wxT("file:") + url;
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user