GNU bug report logs - #6300
browse-url-encode need to encode more

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Sat, 29 May 2010 15:45:02 UTC

Severity: normal

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6300 in the body.
You can then email your comments to 6300 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6300; Package emacs. (Sat, 29 May 2010 15:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 29 May 2010 15:45:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: browse-url-encode need to encode more
Date: Sat, 29 May 2010 13:29:21 +0200
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 "[\"()$]")))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6300; Package emacs. (Wed, 21 Sep 2011 20:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 6300 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 6300 <at> debbugs.gnu.org
Subject: Re: browse-url-encode need to encode more
Date: Wed, 21 Sep 2011 22:23:54 +0200
Lennart Borgman <lennart.borgman <at> 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/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6300; Package emacs. (Wed, 21 Sep 2011 20:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 6300 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: 6300 <at> debbugs.gnu.org
Subject: Re: browse-url-encode need to encode more
Date: Wed, 21 Sep 2011 22:42:15 +0200
On Wed, Sep 21, 2011 at 22:23, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
> Lennart Borgman <lennart.borgman <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6300; Package emacs. (Wed, 21 Sep 2011 21:04:01 GMT) Full text and rfc822 format available.

Message #14 received at 6300 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 6300 <at> debbugs.gnu.org
Subject: Re: browse-url-encode need to encode more
Date: Wed, 21 Sep 2011 22:59:20 +0200
Lennart Borgman <lennart.borgman <at> 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/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6300; Package emacs. (Wed, 09 May 2012 12:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 6300 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: Lennart Borgman <lennart.borgman <at> gmail.com>, 6300 <at> debbugs.gnu.org
Subject: Re: bug#6300: browse-url-encode need to encode more
Date: Wed, 09 May 2012 20:40:28 +0800
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

> Lennart Borgman <lennart.borgman <at> 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.




bug closed, send any further explanations to 6300 <at> debbugs.gnu.org and Lennart Borgman <lennart.borgman <at> gmail.com> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 09 May 2012 12:44:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 07 Jun 2012 11:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 298 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.