<?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>23821</bug_id>
          
          <creation_ts>2013-11-14 04:35:39 +0000</creation_ts>
          <short_desc>The WebSocket constructor resolves the URL using UTF-8, but .url appears to use the document&apos;s encoding as URL character encoding.</short_desc>
          <delta_ts>2013-11-22 07:44:25 +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>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#dom-websocket-url</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96288</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-14 04:35:39 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#dom-websocket-url
Complete: http://www.whatwg.org/c#dom-websocket-url
Referrer: 

Comment:
The WebSocket constructor resolves the URL using UTF-8, but .url appears to
use the document&apos;s encoding as URL character encoding.

Posted from: 59.37.57.226
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.26 Safari/537.36 OPR/18.0.1284.11 (Edition Next)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96670</commentid>
    <comment_count>1</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-21 22:57:57 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8305.
Check-in comment: WebSocket.url should be consistent with how the URL is used in the first place.
http://html5.org/tools/web-apps-tracker?from=8304&amp;to=8305</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96673</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-21 23:29:45 +0000</bug_when>
    <thetext>Note that no browser actually does this per the new spec, currently.
Firefox just passes the URL through unmodified (!).
Safari and Chrome use the doc encoding for the query component and UTF-8 for the path, converting U+263A in the Win1252 query component into %26%239786%3B. I don&apos;t see anything in the URL spec that comes close to this (I don&apos;t even see how the path gets %-encoded, actually).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96688</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-11-22 07:44:25 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #2)
&gt; Note that no browser actually does this per the new spec, currently.

Presto does, it seems. My copy of Safari also (6.0.4).

data:text/html;charset=windows-1252,%3C!DOCTYPE%20html%3E%0A%3Cscript%3Evar%20s%3D%20new%20WebSocket(&apos;ws%3A%2F%2Fexample.invalid%2F%3F%5Cu00e5&apos;)%3B%20alert(s.url)%20%3C%2Fscript%3E

&gt; Firefox just passes the URL through unmodified (!).
&gt; Safari and Chrome use the doc encoding for the query component and UTF-8 for
&gt; the path, converting U+263A in the Win1252 query component into
&gt; %26%239786%3B. I don&apos;t see anything in the URL spec that comes close to this

It looks like the &lt;form&gt; error handling mode

&quot;Otherwise, emit the result of running utf-8 encode on U+0026, U+0023, followed by the shortest sequence of ASCII digits representing c in base ten, followed by U+003B.&quot;
http://encoding.spec.whatwg.org/#error-handling-mode

&gt; (I don&apos;t even see how the path gets %-encoded, actually).

Do you mean in the spec?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>