From: Ben Bucksch Date: Mon, 09 Feb 2009 16:24:20 GMT Subject: Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the default in .gitconfig for git-format-patch.) Message-ID: <499058B4.4070009@beonex.com> In-Reply-To: <4990519C.8060601@drmicha.warpmail.net> On 09.02.2009 16:54, Michael J Gruber wrote: > I don't remember what else you need to quote within
.
>    

Escaping:

With mailto:, you send HTML (SGML) in a URL.

So, you first have to quote using HTML rules:
<   -> <
 >   -> >
&   -> &
"   -> "

If that's not done, TB/Mozilla may or may not fix it up: e.g. if you 
have html tags in your source code, it would probably go wrong without 
quoting.

After that, given that you put it in a URL, you need to escape it using 
"URL component rules" (same as you escape any URL GET parameter), using 
the %charcode rule, e.g.
(space)  ->   %20
=   ->   %3D
&   ->   %26
#   ->   %23
(Firefox does the URL escaping automatically when putting it in the 
URLbar, and you can also try it in JS using encodeURIComponent(), e.g. 
by opening the Firefox Error Console and writing 
encodeURIComponent("foo=bla&bar=baz bal"); or starting the 
yourfirefoxdir/js runner.)

E.g. "<" in original turns into "mailto:?html-body=
%26lt;
"

Sorry that it's non-trivial (I also hate escaping).