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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23969</bug_id>
          
          <creation_ts>2013-12-03 13:48:36 +0000</creation_ts>
          <short_desc>Non-ASCII application/x-www-form-urlencoded</short_desc>
          <delta_ts>2014-01-14 16:12:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>URL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Sapin">simon.sapin</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97039</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2013-12-03 13:48:36 +0000</bug_when>
    <thetext>http://url.spec.whatwg.org/#application/x-www-form-urlencoded

[[
The application/x-www-form-urlencoded parser takes a string input using code points in the range U+0000 to U+007F
]]

Similarly to bug 23958, this parser seems to be called with unrestricted (potentially non-ASCII) input:

new URLSearchParams(&apos;a=☃&apos;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97043</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-03 14:17:01 +0000</bug_when>
    <thetext>So the idea is to make the parser accept a byte sequence and then overload it with a parser that accepts a string. And then if you pass a string it&apos;ll simply utf-8 encode the string and invoke the byte version with the result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97044</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2013-12-03 14:28:36 +0000</bug_when>
    <thetext>I’m a bit worried that, when used with a character encoding not as resilient as UTF-8, percent-escaped sequences could change the meaning of neighboring non-ASCII code points (since the character decoder that is called next doesn’t know what bytes come from the character encoder or from percent-escaping.)

I think I prefer the design where consecutive percent-escaped sequences are character-decoded together. (Ie. percent decoding maps text to text and takes an encoding.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97045</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-03 14:30:40 +0000</bug_when>
    <thetext>The version that accepts strings would only ever use utf-8 and then pass the bytes to the byte version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97046</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2013-12-03 14:44:00 +0000</bug_when>
    <thetext>What about application/x-www-form-urlencoded’s encoding override?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97049</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-03 14:54:45 +0000</bug_when>
    <thetext>I cannot really think of a scenario where that would apply and the input would not be bytes. Probably need to add warnings and such though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98428</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-01-14 16:07:29 +0000</bug_when>
    <thetext>*** Bug 24146 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98430</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-01-14 16:12:10 +0000</bug_when>
    <thetext>Implemented comment 2 plus comment 5.

https://github.com/whatwg/url/commit/3cfaa1779bfb9a3ba2b907a5802ca0251ca9a7e6</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>