[pmwiki-users] Url encoding.

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 21 08:46:59 CST 2005


On Mon, Nov 21, 2005 at 11:07:48AM +0200, Robert Luht wrote:
>    Hi,
> 
>    i would like to add link which contains chars like (,),|.
>    For instance:  http://xxxx.xxx/xxxxx/browse?target=if(xxxxxx).
> 
>    Starting from round bracket text is not interpreted into link.
>    Is it possible to force wiki interpretating given chars into link.?

1.  You can encode the parentheses as %28 and %29 respectively,
thus http://xxxx.xxx/xxxxx/browse?target=if%28xxxxxx%29.

2.  You can change PmWiki's url pattern to allow parentheses in links,
in a local customization file set:

    $UrlExcludeChars = '<>"{}|\\\\^`[\\]\';

Then parentheses will be treated as valid in urls.  However, PmWiki
uses parentheses specially in [[target | text]], so it might not
work in this case (let me know if it doesn't work here and I'll see
about a fix).

Note that RFC 2396 says that "|" in urls should always be escaped
as %7c and not left as a "|".  Yes, RFC 2396 has been obsoleted 
by RFC 3986, which is silent on the use of "|" in urls, but
it's still probably a good idea to use %7c and not "|".  At any
rate, this is another case where PmWiki has a special meaning for "|"
in [[target | text]] links that would need to be ironed out.

Pm




More information about the pmwiki-users mailing list