X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..a7d354c6d75a32033f62b8ecadd837519b35b3ef:/src/common/filesys.cpp diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 2ae9c2dfd3..29e794e570 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -120,15 +120,15 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location) wxTheMimeTypesManager->AddFallbacks(fallbacks); s_MinimalMimeEnsured = true; } - + wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext); if ( !ft || !ft -> GetMimeType(&mime) ) { mime = wxEmptyString; } - + delete ft; - + return mime; } else @@ -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(); }