url-encoding.html (746B)
1 <!doctype html> 2 <meta charset=windows-1252> 3 <title>Fetch: URL encoding</title> 4 <script src=/resources/testharness.js></script> 5 <script src=/resources/testharnessreport.js></script> 6 <script> 7 const expectedURL = new URL("?%C3%9F", location.href).href; 8 const expectedURL2 = new URL("?%EF%BF%BD", location.href).href; 9 test(() => { 10 let r = new Request("?\u00DF"); 11 assert_equals(r.url, expectedURL); 12 13 r = new Request("?\uD83D"); 14 assert_equals(r.url, expectedURL2); 15 }, "URL encoding and Request"); 16 17 promise_test(() => { 18 return fetch("?\u00DF").then(res => { 19 assert_equals(res.url, expectedURL); 20 return fetch("?\uD83D").then(res2 => { 21 assert_equals(res2.url, expectedURL2); 22 }); 23 }); 24 }, "URL encoding and fetch()"); 25 </script>