]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filesys.cpp
better docs for Get/SetLabel methods
[wxWidgets.git] / src / common / filesys.cpp
index 2ae9c2dfd3696bf86cbff9e15ad0bf501d9b8a96..29e794e5705a9e8a795ac82f18b1d28b56e1cdb8 100644 (file)
@@ -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();
 }