<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>14555</bug_id>
          
          <creation_ts>2007-07-07 13:27:26 -0700</creation_ts>
          <short_desc>Spaces should be encoded as %20 in mailto URLs</short_desc>
          <delta_ts>2023-09-20 02:26:24 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>37641</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael A. Puls II">shadow2531</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ahmad.saleem792</cc>
    
    <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>duerst</cc>
    
    <cc>edwardjsabol</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>5200</commentid>
    <comment_count>0</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2007-07-07 13:27:26 -0700</bug_when>
    <thetext>When generating the encoded data set for an action=&quot;mailto:&quot; form, a few things go wrong.

1. Values from the form fields are encoded twice. For example, with &lt;input type=&quot;text&quot; name=&quot;cc&quot; value=&quot;test@site.com&quot;&gt;, test@site.com will be encoded to test%2540site.com instead of just test%40site.com.

2. &quot;body=&quot; is inserted at the beginning of the data set, which causes other parts to become part of the body.

3. Spaces in the form fields are encoded to + instead of %20. Mail clients don&apos;t decode + to a space, so each space in the form fields will show up as + in the mail client.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5201</commentid>
    <comment_count>1</comment_count>
      <attachid>15436</attachid>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2007-07-07 13:28:13 -0700</bug_when>
    <thetext>Created attachment 15436
Descriptive TC. (Will need to minimalize)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5214</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-07-07 14:38:41 -0700</bug_when>
    <thetext>This occurs with a local debug build of WebKit r24089 with Safari 3.0 (522.12) on Mac OS  X 10.4.10 (8R218).

It also occurs with Safari 2.0.4 (419.3) with original WebKit on Mac OS X 10.4.10.

Note that Mail.app correctly parses the body out of the URL (unlike on Windows?), but everything is still improperly twice-encoded.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66046</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-01-02 09:40:57 -0800</bug_when>
    <thetext>Fixed (1) and (2) in &lt;http://trac.webkit.org/projects/webkit/changeset/29086&gt;.

Since other browsers do not seem to encode spaces as suggested in (3), I have left this for later. The test case mentions efforts to get specs corrected - have those been successful? Also, is there a Firefox bug for (3)?

Re-titling and changing priority to match the current scope of the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66094</commentid>
    <comment_count>4</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2008-01-02 17:59:23 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; Fixed (1) and (2) in &lt;http://trac.webkit.org/projects/webkit/changeset/29086&gt;.

Thanks

&gt; Since other browsers do not seem to encode spaces as suggested in (3), I have
&gt; left this for later. The test case mentions efforts to get specs corrected -
&gt; have those been successful? Also, is there a Firefox bug for (3)?

The issue raised at &lt; http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2007-January/009210.html &gt; and &lt; http://lists.w3.org/Archives/Public/public-html/2007May/1061.html &gt; is still not resolved in HTML5 yet because the WebForms part of the spec hasn&apos;t been reviewed and put into HTML5. The editor of Xforms has also seen those links. No one really has given any feedback yet though.

I&apos;ve also mentioned this issue to the authors of RFC2368. They at least recognize the problem and believe that it&apos;s unfortunate that application/x-www-form-urlencoded uses &apos;+&apos; for spaces instead of %20.

For this issue I&apos;ve suggested clarifications in the replacement for RFC2368 &lt; http://tools.ietf.org/html/draft-duerst-mailto-bis-03 &gt;, but it has expired and I have not seen anything come of that yet. Instead, I&apos;ve been making my own  &lt; http://shadow2531.com/opera/testcases/mailto/modern_mailto_uri_scheme.html &gt;, which adresses this in the encoding section and in the forms section (which needs more work, but has a js example of what Firefox does for both GET and POST with action=&quot;mailto:&quot; with an included fix for encoding spaces as %20).

I don&apos;t think there&apos;s a Mozilla bug on this, but I&apos;m pretty sure those in the HTML working group from Mozilla have seen the HTML5 posts above.

I did file an Opera bug though, but forms in Opera with action=&quot;mailto:&quot; are still partially broken, so what Opera does for #3 will have to wait till forms with action=&quot;mailto:&quot; are fixed in general.

For method=&quot;post&quot; and action=&quot;mailto:&quot;, it might not make sense, but for method=&quot;get&quot; and action=&quot;mailto:&quot;, it makes sense for sure to generate spaces as %20 instead of +. (You can easily see how things break when spaces are generated as + instead of %20 like they are now.)

However, you are right, other browsers don&apos;t get it right either. So, I guess we must wait.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66178</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Dürst">duerst</who>
    <bug_when>2008-01-03 22:56:42 -0800</bug_when>
    <thetext>(In reply to comment #3)

&gt; Since other browsers do not seem to encode spaces as suggested in (3), I have
&gt; left this for later. The test case mentions efforts to get specs corrected -
&gt; have those been successful? Also, is there a Firefox bug for (3)?

I have just published http://www.ietf.org/internet-drafts/draft-duerst-mailto-bis-04.txt, intended to obsolete RFC 2368. I made it clear that spaces in mailto URIs have to be escaped as %20, not as +.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>271905</commentid>
    <comment_count>6</comment_count>
    <who name="Martin Dürst">duerst</who>
    <bug_when>2010-08-30 21:15:56 -0700</bug_when>
    <thetext>(In reply to comment #5)

&gt; I have just published http://www.ietf.org/internet-drafts/draft-duerst-mailto-bis-04.txt, intended to obsolete RFC 2368. I made it clear that spaces in mailto URIs have to be escaped as %20, not as +.

The above link doesn&apos;t work anymore, sorry. Please see https://datatracker.ietf.org/doc/draft-duerst-mailto-bis/. This draft has been approved by the IESG, and is now being worked on by the RFC Editor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>271907</commentid>
    <comment_count>7</comment_count>
    <who name="Martin Dürst">duerst</who>
    <bug_when>2010-08-30 21:18:51 -0700</bug_when>
    <thetext>(In reply to comment #4)

&gt; However, you are right, other browsers don&apos;t get it right either. So, I guess we must wait.

I don&apos;t understand why you want to wait for other browsers to fix something before you fix yourself. It may make sense when &quot;being liberal in what you accept&quot;. But it doesn&apos;t make sense here, where the browser produces something, and it&apos;s other software (mailers) that accept it (or not).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>271909</commentid>
    <comment_count>8</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-30 21:21:38 -0700</bug_when>
    <thetext>It&apos;s unclear whether we want to support syntax like the following:

mailto:addr1@an.example,addr2@an.example

The situation requires further study.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>271916</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-30 21:35:52 -0700</bug_when>
    <thetext>Sorry, looks like bugzilla ate the example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>272014</commentid>
    <comment_count>10</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2010-08-31 03:28:10 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #4)
&gt; 
&gt; &gt; However, you are right, other browsers don&apos;t get it right either. So, I guess we must wait.
&gt; 
&gt; I don&apos;t understand why you want to wait for other browsers to fix something before you fix yourself. It may make sense when &quot;being liberal in what you accept&quot;. But it doesn&apos;t make sense here, where the browser produces something, and it&apos;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 &lt;https://datatracker.ietf.org/doc/draft-duerst-mailto-bis/&gt;.

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

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

See:
&lt;http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-January/009210.html&gt;
&lt;http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-October/016858.html&gt;
&lt;http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-December/017667.html&gt;

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&apos;re passing to understands. For example, if Thunderbird doesn&apos;t treat &apos;+&apos; as spaces (which it doesn&apos;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 &apos;+&apos; in @action with &apos;%2B&apos; 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&apos;ll be working with. Don&apos;t modify the attribute&apos;s value.)

2. For method=&quot;not post&quot;, replace all &apos;+&apos; in the generated dataset with &apos;%20&quot;

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

With that said, I see no reason to wait on anything to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>272017</commentid>
    <comment_count>11</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2010-08-31 03:30:31 -0700</bug_when>
    <thetext>&gt; regex

Would be overkill. I meant a simple replacement function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>272225</commentid>
    <comment_count>12</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-08-31 11:21:28 -0700</bug_when>
    <thetext>&gt; 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 &lt;https://datatracker.ietf.org/doc/draft-duerst-mailto-bis/&gt;.

As I said above, I haven&apos;t studied this issue in detail.  However, in general, ignoring the behavior of other browsers is unwise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>273373</commentid>
    <comment_count>13</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2010-09-02 06:49:21 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; &gt; 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 &lt;https://datatracker.ietf.org/doc/draft-duerst-mailto-bis/&gt;.
&gt; 
&gt; As I said above, I haven&apos;t studied this issue in detail.  However, in general, ignoring the behavior of other browsers is unwise.

Understood.

To clarify though:

As far as method!=&quot;post&quot; and method=&quot;post&quot; with enctype=&quot;application/x-www-form-urlencoded&quot; (the default enctype), &lt;http://shadow2531.com/opera/testcases/mailto/mailtoform.js&gt; is what HTML5 is proposing.

Since browsers are broken and non-interoperable with each other, this feature currently can&apos;t be used or relied upon on the web very much. So, HTML5 specs a common ground of what browsers do and what makes sense for interoperability etc. 

There&apos;s only one line in there that&apos;s not part of HTML5 and it&apos;s my suggestion. But, ignoring my suggestion, implementing the rest would be like any HTML5 feature--Implement it and give feedback to the group.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289375</commentid>
    <comment_count>14</comment_count>
    <who name="Martin Dürst">duerst</who>
    <bug_when>2010-10-04 20:58:35 -0700</bug_when>
    <thetext>The new version of the mailto: URI/IRI scheme spec is out now, RFC 6068. Please see http://tools.ietf.org/html/rfc6068.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>15436</attachid>
            <date>2007-07-07 13:28:13 -0700</date>
            <delta_ts>2007-07-07 13:28:13 -0700</delta_ts>
            <desc>Descriptive TC. (Will need to minimalize)</desc>
            <filename>mailtogetform.html</filename>
            <type>text/html</type>
            <size>2643</size>
            <attacher name="Michael A. Puls II">shadow2531</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPGhlYWQ+CiAgICAgICAgPHRpdGxlPmFjdGlvbj0i
bWFpbHRvIiBHRVQgbWV0aG9kPC90aXRsZT4KICAgICAgICA8c3R5bGU+CiAgICAgICAgICAgIGlu
cHV0LCB0ZXh0YXJlYSB7CiAgICAgICAgICAgICAgICBkaXNwbGF5OiBibG9jazsKICAgICAgICAg
ICAgICAgIHdpZHRoOiA1MDBweDsKICAgICAgICAgICAgfQogICAgICAgICAgICB0ZXh0YXJlYSB7
CiAgICAgICAgICAgICAgICBoZWlnaHQ6IDIwMHB4OwogICAgICAgICAgICB9CiAgICAgICAgICAg
IGxpIHsKICAgICAgICAgICAgICAgIHBhZGRpbmc6IDVweDsKICAgICAgICAgICAgfQogICAgICAg
IDwvc3R5bGU+CiAgICA8L2hlYWQ+CiAgICA8Ym9keT4KICAgICAgICA8aDE+YWN0aW9uPSJtYWls
dG8iICsgbWV0aG9kPSJnZXQiPC9oMT4KICAgICAgICA8cD5TdWJtaXR0aW5nIHRoZSBmb2xsb3dp
bmcgZm9ybSBzaG91bGQgZ2VuZXJhdGUgdGhlIGZvbGxvd2luZyBtYWlsdG8gVVJJIGFuZCBpdCBz
aG91bGQgYmUgcGFzc2VkIHRvIHRoZSBkZWZhdWx0IG1haWwgY2xpZW50LiAodGVzdCB3aXRoIFRo
dW5kZXJiaXJkIDMuMCB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