From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Delafond Subject: Links with description and '%3f' in URL fail Date: Thu, 4 Mar 2010 16:06:04 +0000 (UTC) Message-ID: <20100304170052.734@usenet.piggo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnDZR-0006de-8F for emacs-orgmode@gnu.org; Thu, 04 Mar 2010 11:06:41 -0500 Received: from [140.186.70.92] (port=34699 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnDZP-0006cs-Uz for emacs-orgmode@gnu.org; Thu, 04 Mar 2010 11:06:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NnDZP-00084L-Ac for emacs-orgmode@gnu.org; Thu, 04 Mar 2010 11:06:39 -0500 Received: from lo.gmane.org ([80.91.229.12]:57977) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NnDZO-000842-Vz for emacs-orgmode@gnu.org; Thu, 04 Mar 2010 11:06:39 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NnDZI-0004O4-1y for emacs-orgmode@gnu.org; Thu, 04 Mar 2010 17:06:32 +0100 Received: from 64.2.3.200 ([64.2.3.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Mar 2010 17:06:32 +0100 Received: from sdelafond by 64.2.3.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Mar 2010 17:06:32 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Quoting from debian bug report #572404[0]: This error is quite esoteric. Creating a link with a '%3f' escape sequence in its URL (at least HTTP ones) makes it fail to be edited with C-c C-l and exported with the error: org-link-unescape: Wrong type argument: characterp, nil But only if the link has a description. Other escape sequences like '%3e' or '%40' or even the literal '?' corresponding to character 0x3f don't trigger the error. For instance: - http://www.example.com/x%3fx doesn't trigger the error - [[http://www.example.com/x%3fx][test]] triggers the error - [[http://www.example.com/x%3ex][test]] doesn't trigger the error - [[http://www.example.com/x?x][test]] doesn't trigger the error Even more strange, while '%3f' reveals the error, '%3F' does not. I guess the ``org-link-unescape`` function has some serious problems with the handling of '?': when using '%3F' in an HTTP URL, it is unescaped when exported to HTML, resulting most of the time in invalid URLs, since the '?' character separates the path from query arguments. For instance, in "http://x.org/what%3F" the '%3F' should be left as is instead of being exported as "http://x.org/what?". In "http://x.org/query?foo=bar", the '?' should also be left as is. Here it's better to trust the user and leave URLs untouched than trying to be too smart. It at least sounds a like strange that it'd behave diffrently depending on whether or not there is a description alongside the link... Cheers, --Seb [0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572404