After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 596399 - Location bar should show non-latin URLs in unescaped / unicode, but copy them escaped
Location bar should show non-latin URLs in unescaped / unicode, but copy them...
Status: RESOLVED DUPLICATE of bug 710004
Product: epiphany
Classification: Core
Component: Controls
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 416048 672707 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-09-26 03:49 UTC by Kim Nguyễn
Modified: 2014-12-10 19:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
01/02 - Unescape URLs in location bar (723 bytes, patch)
2012-04-29 10:05 UTC, Priit Laes (IRC: plaes)
reviewed Details | Review
02/02 - Unescape URLs in link popup (752 bytes, patch)
2012-04-29 10:06 UTC, Priit Laes (IRC: plaes)
reviewed Details | Review
03 - unescape only spaces when copying URL (4.85 KB, patch)
2012-04-29 11:55 UTC, Priit Laes (IRC: plaes)
reviewed Details | Review
unescape-address-in-location-entry.patch (829 bytes, patch)
2012-08-01 18:17 UTC, Priit Laes (IRC: plaes)
none Details | Review

Description Kim Nguyễn 2009-09-26 03:49:17 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.
Comment 1 Kim Nguyễn 2009-09-26 03:51:03 UTC
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.
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2012-03-31 03:55:43 UTC
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).
Comment 3 Priit Laes (IRC: plaes) 2012-04-29 09:50:39 UTC
+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...
Comment 4 Priit Laes (IRC: plaes) 2012-04-29 10:05:19 UTC
Created attachment 213044 [details] [review]
01/02 - Unescape URLs in location bar
Comment 5 Priit Laes (IRC: plaes) 2012-04-29 10:06:00 UTC
Created attachment 213045 [details] [review]
02/02 - Unescape URLs in link popup
Comment 6 Priit Laes (IRC: plaes) 2012-04-29 11:55:22 UTC
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.
Comment 7 Xan Lopez 2012-08-01 17:56:51 UTC
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.
Comment 8 Xan Lopez 2012-08-01 17:59:06 UTC
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.
Comment 9 Xan Lopez 2012-08-01 18:00:43 UTC
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.
Comment 10 Priit Laes (IRC: plaes) 2012-08-01 18:17:48 UTC
Created attachment 220089 [details] [review]
unescape-address-in-location-entry.patch

Unescape the URL in location entry - use the EphyLocationController to do the unescaping.
Comment 11 Jean-François Fortin Tam 2012-10-08 03:07:06 UTC
*** Bug 416048 has been marked as a duplicate of this bug. ***
Comment 12 Jean-François Fortin Tam 2012-10-08 03:08:30 UTC
*** Bug 672707 has been marked as a duplicate of this bug. ***
Comment 13 Yosef Or Boczko 2014-04-13 11:50:20 UTC
*** Bug 710004 has been marked as a duplicate of this bug. ***
Comment 14 Michael Catanzaro 2014-08-26 23:45:25 UTC
I'd like to land attachment #220089 [details], and a version of attachment #213045 [details] that doesn't leak.
Comment 15 Yosef Or Boczko 2014-08-26 23:47:58 UTC
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 :-)).
Comment 16 Michael Catanzaro 2014-12-10 19:38:35 UTC
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 ***