2009-02-20 Gustavo Noronha Silva <gns@gnome.org>
[WebKit-https.git] / WebCore / platform / network / soup / ResourceHandleSoup.cpp
index 189c2157c363c577ba4418d33dcc08d7480537ff..3c480523e3d3a9013fb96cb84375b4099cfbe01c 100644 (file)
@@ -754,7 +754,13 @@ bool ResourceHandle::startGio(KURL url)
     url.setQuery(String());
     url.setPort(0);
 
-    d->m_gfile = g_file_new_for_uri(url.string().utf8().data());
+    // we avoid the escaping for local files, because
+    // g_filename_from_uri (used internally by GFile) has problems
+    // decoding strings with arbitrary percent signs
+    if (url.isLocalFile())
+        d->m_gfile = g_file_new_for_path(url.prettyURL().utf8().data() + sizeof("file://") - 1);
+    else
+        d->m_gfile = g_file_new_for_uri(url.string().utf8().data());
     g_object_set_data(G_OBJECT(d->m_gfile), "webkit-resource", this);
     d->m_cancellable = g_cancellable_new();
     g_file_query_info_async(d->m_gfile,