| This test verifies handling of text encoding in workers. The behavior matches FF3.1b2 with a single exclusion (see below). |
| This is what's tested: |
| - If http header 'Content-Type' with 'charset' specified is on response with worker script or XHR payload, that encoding is used. |
| - In absence of http header, the script of the worker is decoded using UTF-8. |
| - In absence of http header, the content of the XHR request is decoded using UTF-8. |
| - 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). |
| - The base URL for the worker (used to resolve relative URLs for subworkers and XHR) is the URL of its script. |
| - importScripts() decodes the scripts using UTF-8. |
| Document encoding: windows-1251 |
| Document, Workers: All XHR responses should match this: Привет |
| Document: : XHR: Привет |
| Document: Проверка |
| worker 1: Has no http header with charset |
| worker 1: Original test string: Привет |
| worker 1: PASS: XHR query was encoded in UTF-8: Привет |
| worker 1: Sub: Original test string: Привет |
| worker 1: Sub: Test string encoded using UTF-8: Привет. |
| worker 1: Sub: Test string encoded using Windows-1251: ������. |
| worker 1: Sub: Test string encoded using koi8-r: ������. |
| worker 1: Test string encoded using UTF-8: Привет. |
| worker 1: Test string encoded using Windows-1251: ������. |
| worker 1: Test string encoded using koi8-r: ������. |
| worker 1: XHR: Привет |
| worker 1: XHR: Привет |
| worker 1: exit |
| worker 2: Has http header with charset=koi8-r |
| worker 2: Original test string: Привет |
| worker 2: PASS: XHR query was encoded in UTF-8: Привет |
| worker 2: Sub: Original test string: Привет |
| worker 2: Sub: Test string encoded using UTF-8: Привет. |
| worker 2: Sub: Test string encoded using Windows-1251: ������. |
| worker 2: Sub: Test string encoded using koi8-r: ������. |
| worker 2: Test string encoded using UTF-8: п÷я─п╦п╡п╣я┌. |
| worker 2: Test string encoded using Windows-1251: оПХБЕР. |
| worker 2: Test string encoded using koi8-r: Привет. |
| worker 2: XHR: Привет |
| worker 2: XHR: Привет |
| worker 2: exit |
| |