From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Encoding Problem in export? Date: Wed, 24 Jul 2013 05:39:55 -0400 Message-ID: <87a9lcfg9g.fsf@gmail.com> References: <87bo5s27ey.fsf@sachwertpartner.de> <877ggg7suh.fsf@gmail.com> <51EF32F4.9030309@gmx.de> <87txjk5s2q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1vYQ-000492-Hj for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 05:40:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1vYP-0003vn-0O for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 05:40:18 -0400 Received: from plane.gmane.org ([80.91.229.3]:53366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1vYO-0003vi-QU for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 05:40:16 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V1vYK-0001WG-LF for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 11:40:12 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Jul 2013 11:40:12 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Jul 2013 11:40:12 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nicolas Goaziou writes: > My guess is that your URL is encoded in the original buffer already. Try > to use M-x visible-mode to see what is the real URL. If you see > "http://example.de/?idprop%3D222", it probably means that > `org-link-escape' is a bit too zealous (BTW why don't this function rely > on `url-encode-url'?) FWIW, I think this is correct: using org-insert-link runs org-link-escape with the default org-link-escape-chars which includes '='. I don't know why '=' is included, so I looked to see whether deleting it from org-link-escape-chars would cause problems. Looking at the call sites, org-link-escape is called from: o org-mobile.el but with its own set of escape chars, so that's no problem. o ob-tangle.el from org-babel-tangle-comment-links, which in turn is called (twice) from org-babel-expand-noweb-references. The default org-link-escape-chars is used, so any '=' would get escaped, but whether leaving it out would cause any problems, I don't know. o org-docview.el from org-docview-export with the default escape chars. Again, I don't know if leaving '=' out would cause any problems. o org.el from org-make-link-string (thrice) with the default escape chars and another three times from org-open-at-point, once for a "mailto" link and another two times to open an http/https/ftp/news/doi url but with a smaller set of escape chars that does not include '='. o org-make-link-string is itself called from a bunch of places: org-capture.el, org-clock.el, org.el, org-protocol.el, org-w3m.el. I didn't chase it down through these. I tried a ``git blame'' to see whether the '=' was added for some reason, but it looks as if it's been there ab initio. Maybe the thing to do is to delete '=' from org-link-escape-chars and see what problems arise. But I did find that '%' was originally in org-link-escape-chars and David Maus hardcoded it (commit 139cc1d4), so that it is *always* escaped. I assume there is a good reason for that, but if so, url-encode-url might not be enough - afaict, it leaves '%' signs alone: ,---- | (setq url "http://www.google.org/foo=bar 30%=2") | "http://www.google.org/foo=bar 30%=2" | | (org-link-escape url) | "http://www.google.org/foo%3Dbar%2030%25%3D2" | | (url-encode-url url) | "http://www.google.org/foo=bar%2030%=2" `---- -- Nick