GNOME Bugzilla – Bug 596717
+ (plus) character lost in searches
Last modified: 2009-10-07 10:18:30 UTC
When typing search terms into the address entry field, any + (plus) characters are lost when I hit enter. For example, typing 'c++ blah' and hitting enter results in a google search for 'c blah'.
Created attachment 144707 [details] fix
The fact that I had to add + specifically in the escape_extra makes me wonder, though, if there is a bug in SoupURI. Dan? =)
Not a bug, no. "+" isn't normally reserved in URIs, but the HTML forms spec says that spaces in form parameters should be converted to "+" to make the URLs look nicer in the URL bar ("http://www.google.com/search?q=epiphany+web+browser" rather than "epiphany%20web%20browser") So then of course that means that "+" needs to be %-encoded. Instead of + char *encoded_url = soup_uri_encode (url, "+"); + effective_url = g_strdup_printf (_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8"), encoded_url); you could do: char *query_param = soup_form_encode ("q", url, NULL); effective_url = g_strdup_printf (_("http://www.google.com/search?%s&ie=UTF-8&oe=UTF-8"), query_param); except that changes the translated string... so you'd have to use soup_form_encode() and then chop off the initial "q=" so you can tack it back on in the g_strdup_printf...
(btw, when I click on the attachment [which is currently tagged "application/octet-stream" by bugzilla] it opens in gedit rather then being displayed in epiphany? is content-sniffing happening at the wrong point in the process? or is that not a bug?)
(In reply to comment #4) > (btw, when I click on the attachment [which is currently tagged > "application/octet-stream" by bugzilla] it opens in gedit rather then being > displayed in epiphany? is content-sniffing happening at the wrong point in the > process? or is that not a bug?) Funny, all I can get is simply the download dialog :) BTW, your suggested fix sounds good to me, so Gustavo feel free to commit that instead of the attached patch.
(In reply to comment #4) > (btw, when I click on the attachment [which is currently tagged > "application/octet-stream" by bugzilla] it opens in gedit rather then being > displayed in epiphany? is content-sniffing happening at the wrong point in the > process? or is that not a bug?) Without reinvestigating, being application/octet-stream makes it be sniffed as text/x-patch or something like that, which webkit thinks it isn't able to handle, so that is expected behavior. I don't know why the patches keep being assigned application/octet-stream =(.
Pushed to master, thanks.