1 CONSOLE WARNING: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
2 This test verifies handling of text encoding in workers. The behavior matches FF3.1b2 with a single exclusion (see below).
4 - If http header 'Content-Type' with 'charset' specified is on response with worker script or XHR payload, that encoding is used.
5 - In absence of http header, the script of the worker is decoded using UTF-8.
6 - In absence of http header, the content of the XHR request is decoded using UTF-8.
7 - The URLs used in workers (for subworkers or XHR) are always encoded using UTF-8 (in regular html documents parts of the query an hash may be encoded with other encodings).
8 - The base URL for the worker (used to resolve relative URLs for subworkers and XHR) is the URL of its script.
9 - importScripts() decodes the scripts using UTF-8.
10 Document encoding: windows-1251
11 Document, Workers: All XHR responses should match this: Привет
12 Document: : XHR: Привет
14 worker 1: Has no http header with charset
15 worker 1: Original test string: Привет
16 worker 1: PASS: XHR query was encoded in UTF-8: Привет
17 worker 1: Sub: Original test string: Привет
18 worker 1: Sub: Test string encoded using UTF-8: Привет.
19 worker 1: Sub: Test string encoded using Windows-1251: ������.
20 worker 1: Sub: Test string encoded using koi8-r: ������.
21 worker 1: Test string encoded using UTF-8: Привет.
22 worker 1: Test string encoded using Windows-1251: ������.
23 worker 1: Test string encoded using koi8-r: ������.
27 worker 2: Has http header with charset=koi8-r
28 worker 2: Original test string: Привет
29 worker 2: PASS: XHR query was encoded in UTF-8: Привет
30 worker 2: Sub: Original test string: Привет
31 worker 2: Sub: Test string encoded using UTF-8: Привет.
32 worker 2: Sub: Test string encoded using Windows-1251: ������.
33 worker 2: Sub: Test string encoded using koi8-r: ������.
34 worker 2: Test string encoded using UTF-8: п÷я─п╦п╡п╣я┌.
35 worker 2: Test string encoded using Windows-1251: оПХБЕР.
36 worker 2: Test string encoded using koi8-r: Привет.