From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: larice Newsgroups: gmane.emacs.bugs Subject: bug#40241: Acknowledgement (26.1; browse-url, needs to % hex hex encode the hash char) Date: Thu, 26 Mar 2020 17:49:50 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="58968"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) To: 40241@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 26 18:12:18 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHW3G-000FE7-2r for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Mar 2020 18:12:18 +0100 Original-Received: from localhost ([::1]:56830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHW3F-00056U-3p for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Mar 2020 13:12:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39501) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHW32-0004yk-7d for bug-gnu-emacs@gnu.org; Thu, 26 Mar 2020 13:12:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHW30-0006mk-Sd for bug-gnu-emacs@gnu.org; Thu, 26 Mar 2020 13:12:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53603) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHW30-0006mM-OT for bug-gnu-emacs@gnu.org; Thu, 26 Mar 2020 13:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jHW30-0003Ni-Af for bug-gnu-emacs@gnu.org; Thu, 26 Mar 2020 13:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: larice Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Mar 2020 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40241 X-GNU-PR-Package: emacs X-Debbugs-Original-To: help-debbugs@gnu.org (GNU bug Tracking System) X-Debbugs-Original-Cc: 40241@debbugs.gnu.org Original-Received: via spool by 40241-submit@debbugs.gnu.org id=B40241.158524269612967 (code B ref 40241); Thu, 26 Mar 2020 17:12:02 +0000 Original-Received: (at 40241) by debbugs.gnu.org; 26 Mar 2020 17:11:36 +0000 Original-Received: from localhost ([127.0.0.1]:59576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHW2Z-0003N4-Gy for submit@debbugs.gnu.org; Thu, 26 Mar 2020 13:11:36 -0400 Original-Received: from relay.ccn.net ([217.74.179.22]:52978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHVhe-0002o5-Bq for 40241@debbugs.gnu.org; Thu, 26 Mar 2020 12:49:59 -0400 Original-Received: from ryzok (p5B023CA0.dip0.t-ipconnect.de [91.2.60.160]) (authenticated bits=0) by relay.ccn.net (8.15.2/8.15.2) with ESMTPSA id 02QGnoBm024948 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Mar 2020 17:49:51 +0100 (CET) In-Reply-To: (GNU bug Tracking System's message of "Thu, 26 Mar 2020 15:31:02 +0000") X-Mailman-Approved-At: Thu, 26 Mar 2020 13:11:33 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177753 Archived-At: > Dear Maintainers, > > I couldn't open a link in org mode, which happened > to contain a hash char #. > A search for the culprit revealed usage of this > (setq url (browse-url-encode-url url)) > in several functions, > for example in browse-url-firefox in file browse-url.el > > This function looks like: > > (defun browse-url-encode-url (url) > "Escape annoying characters in URL. > The annoying characters are those that can mislead a web browser > regarding its parameter treatment." > ;; 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 "[\")$] ")) > > I suggest to add the char '#' to the second argument of the > browse-url-url-encode-chars invocation to fix the nuisance. I've to correct myself, and to withdraw my suggestion. The '#' char has special significance in rfc3986 and can't be that easily % hex'ified. My issue is more precisely the following. I've URLs for the search engine of "murata" which look like: http://www.murata.com/en-global/products/productdetail?partno=GRM21BR61E226ME44# At first sight this looks well, but note the trailing '#'. When I enter this interactively into firefox, then it works. If I use %23 instead, it works too. If I pass the URL on the firefox command line, then only the %23 variant works. If I use such an URL in a org mode file, either with # or with %23, then this URL gets un-hexlified to the '#' variant somewhere in org-mode, is then passed to `browse-url-firefox', which passes it unmodified to the command line of a firefox invocation. But that's the variant which doesn't work for firefox. Now this is too exotic, and I simply withdraw my `bug' report. I don't think it is worth the time, neither is it easy to exactly state whats wrong here at all. Perhaps it is the part of org mode which un-hexlifies the URL. I suppose it shouldn't. Then I could have put a %23'fied URL into the org file. As this case is exotic and very specific, I simply add an exception rule to `browse-url-browser-function' like this (defun my-browse-url-generic (url &optional new-window) (browse-url-generic (browse-url-url-encode-chars url "#") new-window)) (setq browse-url-browser-function '(("murata.*#$" . my-browse-url-generic) ("." . browse-url-generic))) and be done with it. Sorry for having wasted your time. Best Regards Robert Larice