unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6300: browse-url-encode need to encode more
@ 2010-05-29 11:29 Lennart Borgman
  2011-09-21 20:23 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Lennart Borgman @ 2010-05-29 11:29 UTC (permalink / raw)
  To: 6300

The character ?" needs to be escaped at least on w32 because otherwise
ShellExecute will not work. Maybe this part of the patch should be
platform specific, I do not know.

Both Google Chrome and Firefox still thinks that it is good manner to
also escape blanks as ?+.

I suggest the following patch (this is agains a checkout from 2010-05-22):

=== modified file 'lisp/net/browse-url.el'
--- trunk/lisp/net/browse-url.el	2010-04-29 14:04:33 +0000
+++ patched/lisp/net/browse-url.el	2010-05-29 10:52:33 +0000
@@ -634,7 +634,8 @@
   ;; FIXME: Is there an actual example of a web browser getting
   ;; confused?  (This used to encode commas, but at least Firefox
   ;; handles commas correctly and doesn't accept encoded commas.)
-  (browse-url-url-encode-chars url "[)$]"))
+  (replace-regexp-in-string " " "+"
+                            (browse-url-url-encode-chars url "[\"()$]")))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#6300: browse-url-encode need to encode more
  2010-05-29 11:29 bug#6300: browse-url-encode need to encode more Lennart Borgman
@ 2011-09-21 20:23 ` Lars Magne Ingebrigtsen
  2011-09-21 20:42   ` Lennart Borgman
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-21 20:23 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 6300

Lennart Borgman <lennart.borgman@gmail.com> writes:

> The character ?" needs to be escaped at least on w32 because otherwise
> ShellExecute will not work. Maybe this part of the patch should be
> platform specific, I do not know.
>
> Both Google Chrome and Firefox still thinks that it is good manner to
> also escape blanks as ?+.
>
> I suggest the following patch (this is agains a checkout from 2010-05-22):
>
> === modified file 'lisp/net/browse-url.el'
> --- trunk/lisp/net/browse-url.el	2010-04-29 14:04:33 +0000
> +++ patched/lisp/net/browse-url.el	2010-05-29 10:52:33 +0000
> @@ -634,7 +634,8 @@
>    ;; FIXME: Is there an actual example of a web browser getting
>    ;; confused?  (This used to encode commas, but at least Firefox
>    ;; handles commas correctly and doesn't accept encoded commas.)
> -  (browse-url-url-encode-chars url "[)$]"))
> +  (replace-regexp-in-string " " "+"
> +                            (browse-url-url-encode-chars url "[\"()$]")))

Is there any reason space shouldn't be quoted as %20 instead?  I.e.,
just add it to the regexp there at the end?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#6300: browse-url-encode need to encode more
  2011-09-21 20:23 ` Lars Magne Ingebrigtsen
@ 2011-09-21 20:42   ` Lennart Borgman
  2011-09-21 20:59     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Lennart Borgman @ 2011-09-21 20:42 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 6300

On Wed, Sep 21, 2011 at 22:23, Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>
>> The character ?" needs to be escaped at least on w32 because otherwise
>> ShellExecute will not work. Maybe this part of the patch should be
>> platform specific, I do not know.
>>
>> Both Google Chrome and Firefox still thinks that it is good manner to
>> also escape blanks as ?+.
>>
>> I suggest the following patch (this is agains a checkout from 2010-05-22):
>>
>> === modified file 'lisp/net/browse-url.el'
>> --- trunk/lisp/net/browse-url.el      2010-04-29 14:04:33 +0000
>> +++ patched/lisp/net/browse-url.el    2010-05-29 10:52:33 +0000
>> @@ -634,7 +634,8 @@
>>    ;; FIXME: Is there an actual example of a web browser getting
>>    ;; confused?  (This used to encode commas, but at least Firefox
>>    ;; handles commas correctly and doesn't accept encoded commas.)
>> -  (browse-url-url-encode-chars url "[)$]"))
>> +  (replace-regexp-in-string " " "+"
>> +                            (browse-url-url-encode-chars url "[\"()$]")))
>
> Is there any reason space shouldn't be quoted as %20 instead?  I.e.,
> just add it to the regexp there at the end?

Yes. Readability.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#6300: browse-url-encode need to encode more
  2011-09-21 20:42   ` Lennart Borgman
@ 2011-09-21 20:59     ` Lars Magne Ingebrigtsen
  2012-05-09 12:40       ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-21 20:59 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 6300

Lennart Borgman <lennart.borgman@gmail.com> writes:

>>> +  (replace-regexp-in-string " " "+"
>>> +                            (browse-url-url-encode-chars url "[\"()$]")))
>>
>> Is there any reason space shouldn't be quoted as %20 instead?  I.e.,
>> just add it to the regexp there at the end?
>
> Yes. Readability.

But if I remember correctly, it's not, strictly speaking, er, correct.

Space can be "+" in the query part of an URL, but should be %20
elsewhere.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#6300: browse-url-encode need to encode more
  2011-09-21 20:59     ` Lars Magne Ingebrigtsen
@ 2012-05-09 12:40       ` Chong Yidong
  0 siblings, 0 replies; 5+ messages in thread
From: Chong Yidong @ 2012-05-09 12:40 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 6300

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Lennart Borgman <lennart.borgman@gmail.com> writes:
>
>>> Is there any reason space shouldn't be quoted as %20 instead?  I.e.,
>>> just add it to the regexp there at the end?
>>
>> Yes. Readability.
>
> But if I remember correctly, it's not, strictly speaking, er, correct.
>
> Space can be "+" in the query part of an URL, but should be %20
> elsewhere.

I committed the change with spaces percent-encoded.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-09 12:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29 11:29 bug#6300: browse-url-encode need to encode more Lennart Borgman
2011-09-21 20:23 ` Lars Magne Ingebrigtsen
2011-09-21 20:42   ` Lennart Borgman
2011-09-21 20:59     ` Lars Magne Ingebrigtsen
2012-05-09 12:40       ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).