Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the default in .gitconfig for git-format-patch.)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

On 09.02.2009 16:54, Michael J Gruber wrote:

Escaping:

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

So, you first have to quote using HTML rules:
<   -> &lt;
 >   -> &gt;
&   -> &amp;
"   -> &quot;

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=<pre>%26lt;<pre>"

Sorry that it's non-trivial (I also hate escaping).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH v2] Enable setting attach as the default in .gi ..., Boyd Stephen Smith Jr., (Sat Feb 7, 10:10 pm)
Re: [PATCH v2] Enable setting attach as the default in .gi ..., Johannes Schindelin, (Sun Feb 8, 10:28 am)
Re: [PATCH v2] Enable setting attach as the default in .gi ..., Johannes Schindelin, (Mon Feb 9, 6:36 am)
Re: [PATCH v2] Enable setting attach as the default in .gi ..., Boyd Stephen Smith Jr., (Mon Feb 9, 7:39 am)
Re: [PATCH v2] Enable setting attach as the default in .gi ..., Johannes Schindelin, (Mon Feb 9, 7:49 am)
Re: Thunderbird and patches (was Re: [PATCH v2] Enable set ..., Ben Bucksch, (Mon Feb 9, 9:24 am)
[PATCH] example patch corrupted by thunderbird, Brandon Casey, (Mon Feb 9, 12:00 pm)
Re: Thunderbird and patches (was Re: [PATCH v2] Enable set ..., Johannes Schindelin, (Mon Feb 9, 12:14 pm)
Re: Thunderbird and patches (was Re: [PATCH v2] Enable set ..., Johannes Schindelin, (Mon Feb 9, 1:09 pm)
Re: Thunderbird and patches, Ben Bucksch, (Mon Feb 9, 3:39 pm)
Re: Thunderbird and patches, Jeremy White, (Mon Feb 9, 3:55 pm)
Re: Thunderbird and patches, Ben Bucksch, (Mon Feb 9, 4:01 pm)
Re: Thunderbird and patches, Miles Bader, (Wed Feb 11, 9:37 pm)
Re: Thunderbird and patches, Michael J Gruber, (Thu Feb 12, 3:07 am)