From 55129143a164e44f832c7438c79310ebe26675d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 28 Mar 2010 15:41:35 +0000 Subject: [PATCH] Fix wxFileSystem::FileNameToURL() for Unicode file names. If filename with non-ASCII characters was encoded, resulting URL contained non-ASCII characters. But URLToFileName() expected the input to be in UTF-8. This change fixes it by using UTF-8 for file: URLs in FileNameToURL() too. Fixes #11491. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filesys.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 1e3740864e..29e794e570 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -694,7 +694,10 @@ wxString wxFileSystem::FileNameToURL(const wxFileName& filename) // here, in particular in GetRightLocation() url.Replace(wxT(":"), wxT("%3A")); url = wxT("file:") + url; - return url; + + // Do wxURI- and common practice-compatible escaping: encode the string + // into UTF-8, then escape anything non-ASCII: + return wxURI(url).BuildURI(); } -- 2.45.2