[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] %20 in file://... URL

From: David Maus
Subject: Re: [Orgmode] %20 in file://... URL
Date: Mon, 29 Nov 2010 21:03:00 +0100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Fri, 26 Nov 2010 23:11:13 +0100,
Vincent Belaïche wrote:
> [1  <text/plain; iso-8859-1 (quoted-printable)>]
> [...]
> > 1. The percent escaping/unescaping functions are not unicode aware;
> My understanding/feeling is that a link in a file foo.org should be
> interpreted with the coding scheme of this file. 

I think this is not reasoble: The information about the coding system
of the file where the link was created is not carried with the link.
E.g. the unescaping function would have no idea about how to properly
unescape the escaped chars.

> Now I am surprised that you write that there is no unicode support, become
> some code like this looks like unicoding the stuff:

You are right: I should have said: The *escaping* function is not
unicode aware.  The unescaping function wasn't neither, but in the
development version on Github I replace the old `org-link-unescape'
with the function formerly known as `org-protocol-unhex-string'.

> > 2. The percent escaping/unescaping functions require a user to
> >    explicitly tell which characters should be escaped;
> That should be dependant on the type of link, file and http should support
> that all characters are escaped, or that no character but % and ] are escaped.

Correct.  The new algorithm escapes characters if one of these
conditions is true:

 - the character is a ASCII control character (<32, 127)
 - the character is the percent sign
 - the character is a non-ASCII character (>127, unicode)
 - the character is in the user supplied list

For unescaping there is no table, it just unescapes all percent
escaped characters.

> I have a question to you: emacs has a url package to interprete url. Why does
> org does not rely on this.

Good question.  This is something to find out: There is C-h v
org-url-encoding-use-url-hexify RET

org-url-encoding-use-url-hexify is a variable defined in `org.el'.
Its value is nil

Not documented as a variable.

This variable was added back in 2009 (commit b077f710) but seems not
used at all.

The only difference I can see is that you can pass org-link-escape in
a table of user defined characters that should be escaped -- but not
sure if this functionality is really needed.

So the next step is check all functions that use escape/unescape and
see if replacing the calls to org-link-escape/unescape can be replaced
with calls to url-hexify/unhexify.

  -- David
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden

Attachment: pgpCu72pAZhCl.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]