[Webkit-unassigned] [Bug 14555] Spaces should be encoded as %20 in mailto URLs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 31 03:28:11 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=14555





--- Comment #10 from Michael A. Puls II <shadow2531 at gmail.com>  2010-08-31 03:28:10 PST ---
(In reply to comment #7)
> (In reply to comment #4)
> 
> > However, you are right, other browsers don't get it right either. So, I guess we must wait.
> 
> I don't understand why you want to wait for other browsers to fix something before you fix yourself. It may make sense when "being liberal in what you accept". But it doesn't make sense here, where the browser produces something, and it's other software (mailers) that accept it (or not).

I was just being patient etc. What I really think is that we should forget about what other browsers do and just do what makes sense and what makes sense is encoding spaces as %20. This is supported by <https://datatracker.ietf.org/doc/draft-duerst-mailto-bis/>.

This is also supported by HTML5 <http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#submit-mailto-headers> for GET, PUT and DELETE, but not POST.

Hixie didn't spec this for a POST dataset though because the whole dataset gets percent-encoded and becomes the body value, so it's not needed. And, if authors decide to use + in @action, it's their fault for not using %20 if they want a space and '%2B' if the want a '+' and things don't come out right in the client (local or http).

See:
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-January/009210.html>
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-October/016858.html>
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-December/017667.html>

But one certain thing was determined: Regardless of how browsers generate action=mailto: form data, they must convert that data to the format the client they're passing to understands. For example, if Thunderbird doesn't treat '+' as spaces (which it doesn't of course), then the browser should use %20 for spaces. 

What this means is that you can fix things with regex if you really wanted to with these rules:

1. Replace all '+' in @action with '%2B' before you do anything else (raw spaces should already be converted to %20 by the resolver). (In a copy of the @action value that you'll be working with. Don't modify the attribute's value.)

2. For method="not post", replace all '+' in the generated dataset with '%20"

Then, everything's good to go and you don't have to modify the form dataset generation code to make an exception for 'mailto'. You can just do the "mailto:" stuff after the fact when @action contains a mailto URI.

With that said, I see no reason to wait on anything to fix this.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list