test_big5_encoder.html (1813B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=912470 5 --> 6 <head> 7 <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> 8 <title>Test for Unicode non-characters</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 </head> 12 <body onload="test()"> 13 <pre id="test"> 14 <script class="testbody" type="text/javascript"> 15 /* NOTE: 16 * When we make our data: URL origin work as in Blink, this test will fail. 17 * Hopefully, by that time are URL parser has become spec-compliant, so that 18 * we'll pass the Web Platform Test for the big5 encoder 19 * (testing/web-platform/tests/encoding/big5-encoder.html) and this test can 20 * simply be removed. 21 */ 22 SimpleTest.waitForExplicitFinish(); 23 24 function test() { 25 var f = document.getElementsByTagName("iframe")[0]; 26 f.onload = function() { 27 var href = SpecialPowers.wrap(f).contentWindow.location.href; 28 var index = href.indexOf("?foo="); 29 var actual = href.substring(index + 5); 30 var expected = "h%26%2340614%3Bi%26%23156267%3Bj%A1%40k%A3%E1l%A4%40m%C8%A4n%C8%CDo%FE%FEp%26%238365%3Bq%FDjr%F9%F9s%26%23128169%3Bt"; 31 is(actual, expected, "Should have gotten the expected encode."); 32 SimpleTest.finish(); 33 } 34 SpecialPowers.wrap(f).contentDocument.forms[0].submit(); 35 } 36 </script> 37 </pre> 38 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=912470">Mozilla Bug 912470</a> 39 <p id="display"></p> 40 <div id="content" style="display: none"><iframe src="data:text/html;charset=big5,<form><input name=foo value=h&%23x9EA6;i&%23x2626B;j&%23x3000;k&%23x20AC;l&%23x4E00;m&%23x27607;n&%23xFFE2;o&%23x79D4;p&%23x20AD;q&%23x203B5;r&%23x2550;s&%23x1F4A9;t></form>"> 41 </div> 42 </body> 43 </html>