[xdg-email] Percent encoding problems
michael.baeuerle at stz-e.de
Wed Aug 20 06:46:03 PDT 2014
The reported version number is 1.0.2, the source package is named
1.1.0-rc1 for its toplevel directory.
The first thing is only a side note:
The 'xdg-email' script request '/bin/sh' as interpreter,
according to  it should do the comparison with "=" instead
of "==" to be portable.
The real problem is the handling of e-mail addresses:
If the address contains a '-', it is percent encoded (even if this is
not required). But if it contains a '?' this stay a literal '?' (what
is not allowed inside a "mailto:" URI according to ).
The problem is that the '-' character is used literally inside a regex
bracket expression (where it has the meaning of a range, like in "a-z"),
look at  (Paragraph 7) for the syntax definition.
The resulting range spans over the '?' character and prevents its
The suggested patches are attached. The '-' is escaped with a backslash.
Maybe the solution from  to put it at the beginning or the end is
cleaner but less obvious.
In  there is also a note that ranges are only guaranteed to work as
expected in the POSIX locale. Therefore the patch sets the locale to
POSIX before starting awk.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the xdg