GNOME Bugzilla – Bug 596399
Location bar should show non-latin URLs in unescaped / unicode, but copy them escaped
Last modified: 2014-12-10 19:38:35 UTC
Steps to reproduce: 1) launch epiphany. 2) focus the url bar and enter: http://idea.nguyen.vg/~kim/my text file.txt The uri will remain as such. If one enters http://idea.nguyen.vg/~kim/my%20text%20file.txt, the file is loaded as well but the %20 is un-escaped back into a white space. It should be the other way around (which was the behaviour of epiphany-gecko AFAIK). It makes it very cumbersome to cut and past the uri in a gnome-terminal for instance since then, when gnome terminal highlight the uri (to be opened with ctrl-click) it stops at the first white space.
Has you can also see from the bug report, the second url with %20 is recognized as a correct link while the first one with spaces stop at the first white space.
Using GNOME 3.4 it seems to be working fine for me. However I am leaving this open because I would like to make the location bar show no escaping, but URL copying to do escaping (like now, but the UI changes to no escapes).
+1 for unescaped strings in location bar. Consider following two examples: http://en.wikipedia.org/wiki/Banach–Tarski_paradox vs http://en.wikipedia.org/wiki/Banach%E2%80%93Tarski_paradox and http://ja.wikipedia.org/wiki/バナッハ=タルスキーのパラドックス vs http://ja.wikipedia.org/wiki/%E3%83%90%E3%83%8A%E3%83%83%E3%83%8F%EF%BC%9D%E3%82%BF%E3%83%AB%E3%82%B9%E3%82%AD%E3%83%BC%E3%81%AE%E3%83%91%E3%83%A9%E3%83%89%E3%83%83%E3%82%AF%E3%82%B9 In order to get unescaped addresses in location bar, I made following change: [snip] diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 038f8ce..ef9dc58 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -2725,7 +2725,7 @@ const char * ephy_web_view_get_address (EphyWebView *view) { EphyWebViewPrivate *priv = view->priv; - return priv->address ? priv->address : "about:blank"; + return priv->address ? g_uri_unescape_string (priv->address, NULL) : "about:blank"; } /** [/snip] Now, how about an option where during copying only whitespace characters (or any other characters that might cause boundary issues) are escaped? This would make copying URLs with non-ascii characters a bit more user-friendly...
Created attachment 213044 [details] [review] 01/02 - Unescape URLs in location bar
Created attachment 213045 [details] [review] 02/02 - Unescape URLs in link popup
Created attachment 213046 [details] [review] 03 - unescape only spaces when copying URL This is WIP patch (tests are in wrong place) but makes it easier to see URLs once they are copied.
Review of attachment 213044 [details] [review]: I don't think this is right. The address we get from EphyWebView should we the 'raw' one. What I would do is make EphyLocationController set a 'beautified' one to the EphyLocationEntry, or have the entry itself beautify the string itself.
Review of attachment 213045 [details] [review]: I think I have the same comment here. Probably ephy_embed_utils_link_message_parse should unescape the string? Either way this patch leaks the result, so it's wrong AFAICT.
Review of attachment 213046 [details] [review]: I suppose we'd need to do something similar for copy&paste in the entry? I think that's why I suggested elsewhere that this bit should be handled by GTK+ itself perhaps.
Created attachment 220089 [details] [review] unescape-address-in-location-entry.patch Unescape the URL in location entry - use the EphyLocationController to do the unescaping.
*** Bug 416048 has been marked as a duplicate of this bug. ***
*** Bug 672707 has been marked as a duplicate of this bug. ***
*** Bug 710004 has been marked as a duplicate of this bug. ***
I'd like to land attachment #220089 [details], and a version of attachment #213045 [details] that doesn't leak.
Oh, no no, this patch dosn't work always. I use it as a temp-solution. It dosn't work with url with some html/unicode, like # in page in wikipedia. I don't know why, but it not work perfect as it work on firefox (please, if you know to fix this, help me :-)).
Let's fold this one in with bug #710004. The "escape only whitespace" change is pretty niche -- not sure if we want to bother adding code for that, but feel free to file a new bug for it if you want. *** This bug has been marked as a duplicate of bug 710004 ***