Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/xhr/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  send-receive-utf16.htm   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/xhr/send-receive-utf16.htm


<!doctype html>
<meta charset=utf-8>
<title>XMLHttpRequest: The send() method: receive data which is UTF-16 encoded</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
    <link rel="help" href="https://xhr.spec.whatwg.org/#text-response" data-tested-assertations="following::ol/li[9]" />
<div id="log"></div>

<script>
  async_test(function() {
    var client = new XMLHttpRequest();
    client.onload = this.step_func_done(function(e) {
      assert_equals(client.responseText, 'æøå\nテスト\n')
    });
    client.open("GET""resources/utf16.txt");
    client.send(null);
  }, 'UTF-16 with BOM, no encoding in content-type');

  async_test(function() {
    var client = new XMLHttpRequest();
    client.onload = this.step_func_done(function(e) {
      assert_equals(client.responseText, 'æøå\nテスト\n')
    });
    client.open("GET""resources/status.py?code=200&type=text%2Fplain%3Bcharset%3DUTF-16&content=%E6%00%F8%00%E5%00%0A%00%C6%30%B9%30%C8%30%0A%00");
    client.send(null);
  }, 'UTF-16 without BOM, with charset label in content-type');

  async_test(function() {
    var client = new XMLHttpRequest();
    client.onload = this.step_func_done(function(e) {
      // plenty of EF BF BD Replacement Character in this invalid input..
      assert_equals(client.responseText, "\ufffd\u0000\ufffd\u0000\ufffd\u0000\u000a\u0000\ufffd\u0030\ufffd\u0030\ufffd\u0030\u000a\u0000")
    });
    client.open("GET""resources/status.py?code=200&type=text%2Fplain%3Bcharset%3DUTF-8&content=%E6%00%F8%00%E5%00%0A%00%C6%30%B9%30%C8%30%0A%00");
    client.send(null);
  }, 'UTF-16 without BOM, mislabelled as UTF-8 in content-type');
</script>

Messung V0.5
C=96 H=98 G=96

¤ Dauer der Verarbeitung: 0.31 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.