emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Encoding Problem in export?
Date: Wed, 24 Jul 2013 05:39:55 -0400	[thread overview]
Message-ID: <87a9lcfg9g.fsf@gmail.com> (raw)
In-Reply-To: 87txjk5s2q.fsf@gmail.com

Nicolas Goaziou <n.goaziou@gmail.com> 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

  parent reply	other threads:[~2013-07-24  9:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 23:17 Encoding Problem in export? Robert Eckl
2013-07-23 23:35 ` Nicolas Goaziou
2013-07-24  1:50   ` Robert Eckl
2013-07-24  7:34     ` Nicolas Goaziou
2013-07-24  8:46       ` Robert Eckl
2013-07-24  9:16         ` Nicolas Goaziou
2013-07-24 10:27           ` Robert Eckl
2013-07-24  9:39       ` Nick Dokos [this message]
2013-07-24 11:09         ` Nicolas Goaziou
2013-07-25  4:05           ` David Maus
2013-07-25 21:46             ` Nicolas Goaziou
2013-07-26  4:03               ` David Maus
2013-07-26 10:20                 ` Nicolas Goaziou
2013-07-27  7:23                   ` David Maus
2013-07-27 11:09                     ` Nicolas Goaziou
2013-07-28  8:36                       ` Jambunathan K
2013-07-28  8:54                         ` Jambunathan K
2013-07-28 11:16                         ` David Maus
2013-07-28 11:22                         ` Nicolas Goaziou
2013-07-29  6:59                           ` Jambunathan K
2013-11-16 15:16       ` Michael Brand
2013-11-16 20:43         ` Nicolas Goaziou
2013-11-17 11:06           ` Michael Brand
2013-11-17 11:46             ` Nicolas Goaziou
2013-11-17 11:51               ` Michael Brand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9lcfg9g.fsf@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).