tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

charset-03.html (1352B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Imported module scripts should always use UTF-8</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 
      7 <script type="module" src="resources/import-utf8.js"></script>
      8 <script type="module">
      9 test(function() {
     10  assert_equals(window.getSomeString(), "śćążź",
     11                'Should be decoded as UTF-8');
     12 }, 'UTF-8 imported module script');
     13 </script>
     14 
     15 <script type="module" src="resources/import-utf8-with-charset-header.js"></script>
     16 <script type="module">
     17 test(function() {
     18  assert_equals(window.getSomeString(), "śćążź",
     19                'Should be decoded as UTF-8');
     20 }, 'UTF-8 imported module script with wrong charset in Content-Type');
     21 </script>
     22 
     23 <script type="module" src="resources/import-non-utf8.js"></script>
     24 <script type="module">
     25 test(function() {
     26  assert_not_equals(window.getSomeString(), "śćążź",
     27                    'Should be decoded as UTF-8');
     28 }, 'Non-UTF-8 imported module script');
     29 </script>
     30 
     31 <script type="module" src="resources/import-non-utf8-with-charset-header.js"></script>
     32 <script type="module">
     33 test(function() {
     34  assert_not_equals(window.getSomeString(), "śćążź",
     35                    'Should be decoded as UTF-8');
     36 }, 'Non-UTF-8 imported module script with charset in Content-Type');
     37 </script>