From 928f37c688d4b898bebd034848b32b4e6d5432bf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 19 Feb 2008 02:37:53 +0000 Subject: [PATCH] don't encode collons in file:// URLs under Windows as IE is incapable of opening them (and other browsers can open both forms) (patch 1890922) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filesys.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 038e55407f..9048f988c0 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -663,7 +663,14 @@ wxString wxFileSystem::FileNameToURL(const wxFileName& filename) url.Replace(g_nativePathString, g_unixPathString); url.Replace(wxT("%"), wxT("%25")); // '%'s must be replaced first! url.Replace(wxT("#"), wxT("%23")); +#ifndef __WXMSW__ + // even though encoding the colon is (AFAICS) the right thing to do, we + // shouldn't do this under Windows because IE refuses to handle the + // resulting file:// URLs and Firefox and Opera (and probably all the other + // browsers as they need to be IE-compatible anyhow) open both the versions + // with ':' and "%3A", so leave the colon alone to keep IE happy url.Replace(wxT(":"), wxT("%3A")); +#endif // __WXMSW__ url = wxT("file:") + url; return url; }