View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.encoding;
16  
17  import static java.nio.charset.StandardCharsets.ISO_8859_1;
18  import static java.nio.charset.StandardCharsets.UTF_8;
19  
20  import java.net.URL;
21  import java.nio.charset.Charset;
22  import java.nio.charset.StandardCharsets;
23  import java.util.ArrayList;
24  import java.util.Collection;
25  import java.util.List;
26  
27  import org.apache.commons.io.ByteOrderMark;
28  import org.apache.commons.lang3.ArrayUtils;
29  import org.htmlunit.WebDriverTestCase;
30  import org.htmlunit.javascript.host.css.CSSStyleSheet;
31  import org.htmlunit.junit.annotation.Alerts;
32  import org.htmlunit.util.MimeType;
33  import org.junit.jupiter.params.ParameterizedTest;
34  import org.junit.jupiter.params.provider.Arguments;
35  import org.junit.jupiter.params.provider.MethodSource;
36  import org.openqa.selenium.WebDriver;
37  import org.openqa.selenium.WebDriverException;
38  
39  /**
40   * Tests encoding handling for {@link CSSStyleSheet}.
41   *
42   * @author Ronald Brill
43   * @author Lai Quang Duong
44   */
45  public class CssStyleSheetEncodingTest extends WebDriverTestCase {
46  
47      private static final String BOM_UTF_16LE = "BOMUTF16LE";
48      private static final String BOM_UTF_16BE = "BOMUTF16BE";
49      private static final String BOM_UTF_8 = "BOMUTF8";
50  
51      private static int ServerRestartCount_ = 0;
52  
53      private enum TestCharset {
54          UTF8("UTF8", UTF_8),
55          ISO88591("ISO88591", ISO_8859_1),
56          GB2312("GB2312", Charset.forName("GB2312"));
57  
58          private final String label_;
59          private final Charset charset_;
60  
61          TestCharset(final String label, final Charset charset) {
62              label_ = label;
63              charset_ = charset;
64          }
65  
66          @Override
67          public String toString() {
68              return label_;
69          }
70  
71          public Charset getCharset() {
72              return charset_;
73          }
74      }
75  
76      /**
77       * Returns the parameterized data.
78       * @return the parameterized data
79       * @throws Exception if an error occurs
80       */
81      public static Collection<Arguments> data() throws Exception {
82          final List<Arguments> list = new ArrayList<>();
83  
84          final TestCharset[] charsetHtmlResponseHeader =
85                  new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.GB2312};
86          final TestCharset[] charsetResponseHeader = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
87          final TestCharset[] charsetResponseEncoding = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
88          final TestCharset[] charsetAt = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
89          final String[] bom = {null, BOM_UTF_8, BOM_UTF_16LE, BOM_UTF_16BE};
90  
91          for (final Object charsetHtml : charsetHtmlResponseHeader) {
92              for (final Object responseHeader : charsetResponseHeader) {
93                  for (final Object responseEncoding : charsetResponseEncoding) {
94                      for (final Object at : charsetAt) {
95                          for (final Object b : bom) {
96                              list.add(Arguments.of(charsetHtml, responseHeader, responseEncoding, at, b));
97                          }
98                      }
99                  }
100             }
101         }
102         return list;
103     }
104 
105     /**
106      * The default test.
107      * @throws Exception if an error occurs
108      */
109     @ParameterizedTest(name = "_{0}_{1}_{2}_{3}_{4}")
110     @MethodSource("data")
111     @Alerts({"\"a\"", "\"\u00E4\"", "\"\u0623\u0647\u0644\u0627\u064B\"", "\"\u043C\u0438\u0440\"", "\"\u623F\u95F4\""})
112     void charset(
113             final TestCharset charsetHtmlResponse,
114             final TestCharset charsetCssResponseHeader,
115             final TestCharset charsetCssResponseEncoding,
116             final TestCharset charsetCssAt,
117             final String bom) throws Exception {
118 
119         // use always a different url to avoid caching effects
120         final URL cssUrl = new URL(URL_SECOND, "" + System.currentTimeMillis() + ".js");
121 
122         final String html = DOCTYPE_HTML
123             + "<html><head>\n"
124             + "  <link rel='stylesheet' href='" + cssUrl + "'/>\n"
125             + "<script>\n"
126             + LOG_TITLE_FUNCTION
127             + "  function test() {\n"
128             + "    var node = document.getElementById('c1');\n"
129             + "    var style = window.getComputedStyle(node, ':before');\n"
130             + "    log(style.content);\n"
131 
132             + "    node = document.getElementById('c2');\n"
133             + "    style = window.getComputedStyle(node, ':before');\n"
134             + "    log(style.content);\n"
135 
136             + "    node = document.getElementById('c3');\n"
137             + "    style = window.getComputedStyle(node, ':before');\n"
138             + "    log(style.content);\n"
139 
140             + "    node = document.getElementById('c4');\n"
141             + "    style = window.getComputedStyle(node, ':before');\n"
142             + "    log(style.content);\n"
143 
144             + "    node = document.getElementById('c5');\n"
145             + "    style = window.getComputedStyle(node, ':before');\n"
146             + "    log(style.content);\n"
147             + "  }\n"
148             + "</script>\n"
149             + "</head>\n"
150             + "<body onload='test()'>\n"
151             + "  <div id='c1' class='c1'>C1</div>\n"
152             + "  <div id='c2' class='c2'>C2</div>\n"
153             + "  <div id='c3' class='c3'>C3</div>\n"
154             + "  <div id='c4' class='c4'>C4</div>\n"
155             + "  <div id='c5' class='c5'>C5</div>\n"
156             + "</body>\n"
157             + "</html>";
158 
159         String cssContentType = MimeType.TEXT_CSS;
160         if (charsetCssResponseHeader != null) {
161             cssContentType = cssContentType + "; charset="
162                                     + charsetCssResponseHeader.getCharset().name().toLowerCase();
163         }
164 
165         String css = ".c1::before { content: \"a\"}"
166                 + ".c2::before { content: \"\u00E4\"}"
167                 + ".c3::before { content: \"\u0623\u0647\u0644\u0627\u064B\"}"
168                 + ".c4::before { content: \"\u043C\u0438\u0440\"}"
169                 + ".c5::before { content: \"\u623F\u95F4\"}";
170 
171         if (charsetCssAt != null) {
172             css = "@charset \"" + charsetCssAt.name() + "\";\n" + css;
173         }
174 
175         byte[] style = null;
176         if (charsetCssResponseEncoding == null) {
177             style = css.getBytes(UTF_8);
178         }
179         else {
180             style = css.getBytes(charsetCssResponseEncoding.getCharset());
181         }
182 
183         if (BOM_UTF_8.equals(bom)) {
184             style = ArrayUtils.addAll(ByteOrderMark.UTF_8.getBytes(), css.getBytes(StandardCharsets.UTF_8));
185         }
186         else if (BOM_UTF_16BE.equals(bom)) {
187             style = ArrayUtils.addAll(ByteOrderMark.UTF_16BE.getBytes(), css.getBytes(StandardCharsets.UTF_16BE));
188         }
189         else if (BOM_UTF_16LE.equals(bom)) {
190             style = ArrayUtils.addAll(ByteOrderMark.UTF_16LE.getBytes(), css.getBytes(StandardCharsets.UTF_16LE));
191         }
192         getMockWebConnection().setResponse(cssUrl, style, 200, "OK", cssContentType, null);
193 
194         String htmlContentType = MimeType.TEXT_HTML;
195         if (charsetHtmlResponse != null) {
196             htmlContentType = htmlContentType + "; charset=" + charsetHtmlResponse.getCharset().name();
197         }
198 
199         Charset htmlResponseCharset = ISO_8859_1;
200         if (charsetHtmlResponse != null) {
201             htmlResponseCharset = charsetHtmlResponse.getCharset();
202         }
203 
204         expandExpectedAlertsVariables(URL_FIRST);
205         final String[] expectedAlerts = getExpectedAlerts();
206         try {
207             ServerRestartCount_++;
208             if (ServerRestartCount_ == 200) {
209                 stopWebServers();
210                 ServerRestartCount_ = 0;
211             }
212             final WebDriver driver = loadPage2(html, URL_FIRST, htmlContentType, htmlResponseCharset, null);
213 
214             assertEquals(String.join("\u00A7", getExpectedAlerts()) + '\u00A7', driver.getTitle());
215         }
216         catch (final WebDriverException e) {
217             if (!e.getCause().getMessage().contains("illegal character")
218                 && !e.getCause().getMessage().contains("is not defined.")) {
219                 throw e;
220             }
221 
222             assertTrue(expectedAlerts.length == 1);
223             final String msg = e.getCause().getMessage();
224             assertTrue(msg, msg.contains(expectedAlerts[0]));
225         }
226     }
227 
228     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
229     void _ISO88591_null_null_null_null() throws Exception {
230         charset(TestCharset.ISO88591, null, null, null, null);
231     }
232 
233     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
234     void _ISO88591_null_UTF8_null_null() throws Exception {
235         charset(TestCharset.ISO88591, null, TestCharset.UTF8, null, null);
236     }
237 
238     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
239     void _ISO88591_null_ISO88591_null_null() throws Exception {
240         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, null, null);
241     }
242 
243     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
244     void _ISO88591_UTF8_ISO88591_null_null() throws Exception {
245         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, null);
246     }
247 
248     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
249     void _ISO88591_ISO88591_null_null_null() throws Exception {
250         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, null, null);
251     }
252 
253     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
254     void _ISO88591_ISO88591_null_null_BOMUTF8() throws Exception {
255         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, null, BOM_UTF_8);
256     }
257 
258     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
259     void _ISO88591_ISO88591_UTF8_null_null() throws Exception {
260         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, null);
261     }
262 
263     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
264     void _ISO88591_ISO88591_UTF8_null_BOMUTF8() throws Exception {
265         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_8);
266     }
267 
268     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
269     void _ISO88591_ISO88591_ISO88591_null_null() throws Exception {
270         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, null);
271     }
272 
273     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
274     void _ISO88591_ISO88591_ISO88591_null_BOMUTF16BE() throws Exception {
275         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16BE);
276     }
277 
278     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
279     void _ISO88591_ISO88591_ISO88591_null_BOMUTF16LE() throws Exception {
280         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16BE);
281     }
282 
283     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
284     void _ISO88591_ISO88591_UTF8_null_BOMUTF16BE() throws Exception {
285         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16BE);
286     }
287 
288     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
289     void _ISO88591_ISO88591_UTF8_null_BOMUTF16LE() throws Exception {
290         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16BE);
291     }
292 
293     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
294     void _ISO88591_ISO88591_null_null_BOMUTF16BE() throws Exception {
295         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, null, BOM_UTF_16BE);
296     }
297 
298     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
299     void _ISO88591_ISO88591_null_null_BOMUTF16LE() throws Exception {
300         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, null, BOM_UTF_16LE);
301     }
302 
303     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
304     void _ISO88591_UTF8_UTF8_null_BOMUTF16BE() throws Exception {
305         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16BE);
306     }
307 
308     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
309     void _ISO88591_UTF8_UTF8_null_BOMUTF16LE() throws Exception {
310         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16LE);
311     }
312 
313     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
314     void _ISO88591_UTF8_null_null_BOMUTF16BE() throws Exception {
315         charset(TestCharset.ISO88591, TestCharset.UTF8, null, null, BOM_UTF_16BE);
316     }
317 
318     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
319     void _ISO88591_UTF8_null_null_BOMUTF16LE() throws Exception {
320         charset(TestCharset.ISO88591, TestCharset.UTF8, null, null, BOM_UTF_16LE);
321     }
322 
323     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
324     void _ISO88591_UTF8_ISO88591_null_BOMUTF16BE() throws Exception {
325         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16BE);
326     }
327 
328     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
329     void _ISO88591_UTF8_ISO88591_null_BOMUTF16LE() throws Exception {
330         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16LE);
331     }
332 
333     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
334     void _UTF8_null_ISO88591_null_null() throws Exception {
335         charset(TestCharset.UTF8, null, TestCharset.ISO88591, null, null);
336     }
337 
338     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
339     void _UTF8_ISO88591_ISO88591_null_null() throws Exception {
340         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, null);
341     }
342 
343     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
344     void _UTF8_ISO88591_UTF8_null_null() throws Exception {
345         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, null);
346     }
347 
348     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
349     void _UTF8_ISO88591_null_null_null() throws Exception {
350         charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, null);
351     }
352 
353     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
354     void _UTF8_UTF8_ISO88591_null_null() throws Exception {
355         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, null);
356     }
357 
358     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
359     void _UTF8_UTF8_ISO88591_null_BOMUTF16BE() throws Exception {
360         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16BE);
361     }
362 
363     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
364     void _UTF8_UTF8_ISO88591_null_BOMUTF16LE() throws Exception {
365         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16LE);
366     }
367 
368     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
369     void _UTF8_UTF8_UTF8_null_BOMUTF16BE() throws Exception {
370         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16BE);
371     }
372 
373     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
374     void _UTF8_UTF8_UTF8_null_BOMUTF16LE() throws Exception {
375         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16LE);
376     }
377 
378     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
379     void _UTF8_UTF8_null_null_BOMUTF16BE() throws Exception {
380         charset(TestCharset.UTF8, TestCharset.UTF8, null, null, BOM_UTF_16BE);
381     }
382 
383     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
384     void _UTF8_UTF8_null_null_BOMUTF16LE() throws Exception {
385         charset(TestCharset.UTF8, TestCharset.UTF8, null, null, BOM_UTF_16LE);
386     }
387 
388     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
389     void _UTF8_ISO88591_UTF8_null_BOMUTF8() throws Exception {
390         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_8);
391     }
392 
393     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
394     void _UTF8_ISO88591_null_null_BOMUTF8() throws Exception {
395         charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, BOM_UTF_8);
396     }
397 
398     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
399     void _null_ISO88591_ISO88591_null_null() throws Exception {
400         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, null, null);
401     }
402 
403     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
404     void _null_ISO88591_UTF8_null_null() throws Exception {
405         charset(null, TestCharset.ISO88591, TestCharset.UTF8, null, null);
406     }
407 
408     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
409     void _null_ISO88591_null_null_null() throws Exception {
410         charset(null, TestCharset.ISO88591, null, null, null);
411     }
412 
413     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
414     void _null_UTF8_ISO88591_null_null() throws Exception {
415         charset(null, TestCharset.UTF8, TestCharset.ISO88591, null, null);
416     }
417 
418     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
419     void _null_UTF8_ISO88591_null_BOMUTF16BE() throws Exception {
420         charset(null, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16BE);
421     }
422 
423     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
424     void _null_UTF8_ISO88591_null_BOMUTF16LE() throws Exception {
425         charset(null, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16LE);
426     }
427 
428     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
429     void _null_UTF8_UTF8_null_BOMUTF16BE() throws Exception {
430         charset(null, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16BE);
431     }
432 
433     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
434     void _null_UTF8_UTF8_null_BOMUTF16LE() throws Exception {
435         charset(null, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16LE);
436     }
437 
438     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
439     void _null_UTF8_null_null_BOMUTF16BE() throws Exception {
440         charset(null, TestCharset.UTF8, null, null, BOM_UTF_16BE);
441     }
442 
443     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
444     void _null_UTF8_null_null_BOMUTF16LE() throws Exception {
445         charset(null, TestCharset.UTF8, null, null, BOM_UTF_16LE);
446     }
447 
448     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
449     void _null_null_ISO88591_null_null() throws Exception {
450         charset(null, null, TestCharset.ISO88591, null, null);
451     }
452 
453     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
454     void _null_null_UTF8_null_null() throws Exception {
455         charset(null, null, TestCharset.UTF8, null, null);
456     }
457 
458     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
459     void _null_null_null_null_null() throws Exception {
460         charset(null, null, null, null, null);
461     }
462 
463     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
464     void _null_ISO88591_UTF8_null_BOMUTF8() throws Exception {
465         charset(null, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_8);
466     }
467 
468     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
469     void _null_ISO88591_null_null_BOMUTF8() throws Exception {
470         charset(null, TestCharset.ISO88591, null, null, BOM_UTF_8);
471     }
472 
473     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
474     void _GB2312_ISO88591_ISO88591_null_null() throws Exception {
475         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, null, null);
476     }
477 
478     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
479     void _GB2312_ISO88591_UTF8_null_null() throws Exception {
480         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, null, null);
481     }
482 
483     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
484     void _GB2312_ISO88591_null_null_null() throws Exception {
485         charset(TestCharset.GB2312, TestCharset.ISO88591, null, null, null);
486     }
487 
488     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
489     void _GB2312_UTF8_ISO88591_null_null() throws Exception {
490         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, null, null);
491     }
492 
493     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
494     void _GB2312_null_ISO88591_null_null() throws Exception {
495         charset(TestCharset.GB2312, null, TestCharset.ISO88591, null, null);
496     }
497 
498     @Alerts({"\"a\"", "\"盲\"", "\"兀賴賱丕賸\"", "\"屑懈褉\"", "\"鎴块棿\""})
499     void _GB2312_null_UTF8_null_null() throws Exception {
500         charset(TestCharset.GB2312, null, TestCharset.UTF8, null, null);
501     }
502 
503     @Alerts({"\"a\"", "\"盲\"", "\"兀賴賱丕賸\"", "\"屑懈褉\"", "\"鎴块棿\""})
504     void _GB2312_null_null_null_null() throws Exception {
505         charset(TestCharset.GB2312, null, null, null, null);
506     }
507 
508     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
509     void _GB2312_ISO88591_UTF8_null_BOMUTF8() throws Exception {
510         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_8);
511     }
512 
513     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
514     void _GB2312_ISO88591_null_null_BOMUTF8() throws Exception {
515         charset(TestCharset.GB2312, TestCharset.ISO88591, null, null, BOM_UTF_8);
516     }
517 
518     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
519     void _GB2312_ISO88591_ISO88591_null_BOMUTF8() throws Exception {
520         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_8);
521     }
522 
523     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
524     void _GB2312_ISO88591_ISO88591_null_BOMUTF16BE() throws Exception {
525         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16BE);
526     }
527 
528     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
529     void _GB2312_ISO88591_ISO88591_null_BOMUTF16LE() throws Exception {
530         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16LE);
531     }
532 
533     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
534     void _GB2312_ISO88591_UTF8_null_BOMUTF16BE() throws Exception {
535         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16BE);
536     }
537 
538     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
539     void _GB2312_ISO88591_UTF8_null_BOMUTF16LE() throws Exception {
540         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16LE);
541     }
542 
543     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
544     void _GB2312_ISO88591_null_null_BOMUTF16BE() throws Exception {
545         charset(TestCharset.GB2312, TestCharset.ISO88591, null, null, BOM_UTF_16BE);
546     }
547 
548     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
549     void _GB2312_ISO88591_null_null_BOMUTF16LE() throws Exception {
550         charset(TestCharset.GB2312, TestCharset.ISO88591, null, null, BOM_UTF_16LE);
551     }
552 
553     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
554     void _ISO88591_ISO88591_ISO88591_null_BOMUTF8() throws Exception {
555         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_8);
556     }
557 
558     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
559     void _UTF8_ISO88591_ISO88591_null_BOMUTF8() throws Exception {
560         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_8);
561     }
562 
563     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
564     void _UTF8_ISO88591_ISO88591_null_BOMUTF16BE() throws Exception {
565         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16BE);
566     }
567 
568     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
569     void _UTF8_ISO88591_ISO88591_null_BOMUTF16LE() throws Exception {
570         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16LE);
571     }
572 
573     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
574     void _UTF8_ISO88591_UTF8_null_BOMUTF16BE() throws Exception {
575         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16BE);
576     }
577 
578     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
579     void _UTF8_ISO88591_UTF8_null_BOMUTF16LE() throws Exception {
580         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16LE);
581     }
582 
583     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
584     void _UTF8_ISO88591_null_null_BOMUTF16BE() throws Exception {
585         charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, BOM_UTF_16BE);
586     }
587 
588     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
589     void _UTF8_ISO88591_null_null_BOMUTF16LE() throws Exception {
590         charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, BOM_UTF_16LE);
591     }
592 
593     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
594     void _null_ISO88591_ISO88591_null_BOMUTF8() throws Exception {
595         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_8);
596     }
597 
598     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
599     void _null_ISO88591_ISO88591_null_BOMUTF16BE() throws Exception {
600         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16BE);
601     }
602 
603     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
604     void _null_ISO88591_ISO88591_null_BOMUTF16LE() throws Exception {
605         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16LE);
606     }
607 
608     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
609     void _null_ISO88591_UTF8_null_BOMUTF16BE() throws Exception {
610         charset(null, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16BE);
611     }
612 
613     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
614     void _null_ISO88591_UTF8_null_BOMUTF16LE() throws Exception {
615         charset(null, TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16LE);
616     }
617 
618     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
619     void _null_ISO88591_null_null_BOMUTF16BE() throws Exception {
620         charset(null, TestCharset.ISO88591, null, null, BOM_UTF_16BE);
621     }
622 
623     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
624     void _null_ISO88591_null_null_BOMUTF16LE() throws Exception {
625         charset(null, TestCharset.ISO88591, null, null, BOM_UTF_16LE);
626     }
627 
628     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
629     void _GB2312_UTF8_ISO88591_null_BOMUTF16BE() throws Exception {
630         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16BE);
631     }
632 
633     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
634     void _GB2312_UTF8_ISO88591_null_BOMUTF16LE() throws Exception {
635         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_16LE);
636     }
637 
638     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
639     void _GB2312_UTF8_UTF8_null_BOMUTF16BE() throws Exception {
640         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16BE);
641     }
642 
643     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
644     void _GB2312_UTF8_UTF8_null_BOMUTF16LE() throws Exception {
645         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16LE);
646     }
647 
648     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
649     void _GB2312_UTF8_null_null_BOMUTF16BE() throws Exception {
650         charset(TestCharset.GB2312, TestCharset.UTF8, null, null, BOM_UTF_16BE);
651     }
652 
653     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
654     void _GB2312_UTF8_null_null_BOMUTF16LE() throws Exception {
655         charset(TestCharset.GB2312, TestCharset.UTF8, null, null, BOM_UTF_16LE);
656     }
657 
658     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
659     void _GB2312_ISO88591_ISO88591_UTF8_null() throws Exception {
660         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null);
661     }
662 
663     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
664     void _GB2312_ISO88591_UTF8_UTF8_null() throws Exception {
665         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, null);
666     }
667 
668     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
669     void _GB2312_ISO88591_null_UTF8_null() throws Exception {
670         charset(TestCharset.GB2312, TestCharset.ISO88591, null, TestCharset.UTF8, null);
671     }
672 
673     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
674     void _GB2312_UTF8_ISO88591_UTF8_null() throws Exception {
675         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null);
676     }
677 
678     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
679     void _GB2312_null_ISO88591_UTF8_null() throws Exception {
680         charset(TestCharset.GB2312, null, TestCharset.ISO88591, TestCharset.UTF8, null);
681     }
682 
683     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
684     void _ISO88591_ISO88591_ISO88591_UTF8_null() throws Exception {
685         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null);
686     }
687 
688     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
689     void _ISO88591_ISO88591_UTF8_UTF8_null() throws Exception {
690         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, null);
691     }
692 
693     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
694     void _ISO88591_ISO88591_null_UTF8_null() throws Exception {
695         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, TestCharset.UTF8, null);
696     }
697 
698     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
699     void _ISO88591_UTF8_ISO88591_UTF8_null() throws Exception {
700         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null);
701     }
702 
703     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
704     void _ISO88591_null_ISO88591_UTF8_null() throws Exception {
705         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, TestCharset.UTF8, null);
706     }
707 
708     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
709     void _UTF8_ISO88591_ISO88591_UTF8_null() throws Exception {
710         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null);
711     }
712 
713     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
714     void _UTF8_ISO88591_UTF8_UTF8_null() throws Exception {
715         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, null);
716     }
717 
718     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
719     void _UTF8_ISO88591_null_UTF8_null() throws Exception {
720         charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.UTF8, null);
721     }
722 
723     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
724     void _UTF8_UTF8_ISO88591_UTF8_null() throws Exception {
725         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null);
726     }
727 
728     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
729     void _UTF8_null_ISO88591_UTF8_null() throws Exception {
730         charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.UTF8, null);
731     }
732 
733     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
734     void _null_ISO88591_ISO88591_UTF8_null() throws Exception {
735         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null);
736     }
737 
738     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
739     void _null_ISO88591_UTF8_UTF8_null() throws Exception {
740         charset(null, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, null);
741     }
742 
743     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
744     void _null_ISO88591_null_UTF8_null() throws Exception {
745         charset(null, TestCharset.ISO88591, null, TestCharset.UTF8, null);
746     }
747 
748     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
749     void _null_UTF8_ISO88591_UTF8_null() throws Exception {
750         charset(null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null);
751     }
752 
753     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
754     void _null_null_ISO88591_UTF8_null() throws Exception {
755         charset(null, null, TestCharset.ISO88591, TestCharset.UTF8, null);
756     }
757 
758     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
759     void _GB2312_ISO88591_ISO88591_ISO88591_null() throws Exception {
760         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null);
761     }
762 
763     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
764     void _GB2312_ISO88591_UTF8_ISO88591_null() throws Exception {
765         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null);
766     }
767 
768     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
769     void _GB2312_UTF8_ISO88591_ISO88591_null() throws Exception {
770         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null);
771     }
772 
773     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
774     void _GB2312_ISO88591_null_ISO88591_null() throws Exception {
775         charset(TestCharset.GB2312, TestCharset.ISO88591, null, TestCharset.ISO88591, null);
776     }
777 
778     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
779     void _GB2312_null_ISO88591_ISO88591_null() throws Exception {
780         charset(TestCharset.GB2312, null, TestCharset.ISO88591, TestCharset.ISO88591, null);
781     }
782 
783     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
784     void _GB2312_null_UTF8_ISO88591_null() throws Exception {
785         charset(TestCharset.GB2312, null, TestCharset.UTF8, TestCharset.ISO88591, null);
786     }
787 
788     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
789     void _GB2312_null_null_ISO88591_null() throws Exception {
790         charset(TestCharset.GB2312, null, null, TestCharset.ISO88591, null);
791     }
792 
793     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
794     void _ISO88591_ISO88591_ISO88591_ISO88591_null() throws Exception {
795         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null);
796     }
797 
798     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
799     void _ISO88591_ISO88591_UTF8_ISO88591_null() throws Exception {
800         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null);
801     }
802 
803     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
804     void _ISO88591_ISO88591_null_ISO88591_null() throws Exception {
805         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, TestCharset.ISO88591, null);
806     }
807 
808     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
809     void _ISO88591_UTF8_ISO88591_ISO88591_null() throws Exception {
810         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null);
811     }
812 
813     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
814     void _ISO88591_null_ISO88591_ISO88591_null() throws Exception {
815         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, TestCharset.ISO88591, null);
816     }
817 
818     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
819     void _ISO88591_null_UTF8_ISO88591_null() throws Exception {
820         charset(TestCharset.ISO88591, null, TestCharset.UTF8, TestCharset.ISO88591, null);
821     }
822 
823     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
824     void _ISO88591_null_null_ISO88591_null() throws Exception {
825         charset(TestCharset.ISO88591, null, null, TestCharset.ISO88591, null);
826     }
827 
828     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
829     void _UTF8_ISO88591_ISO88591_ISO88591_null() throws Exception {
830         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null);
831     }
832 
833     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
834     void _UTF8_ISO88591_UTF8_ISO88591_null() throws Exception {
835         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null);
836     }
837 
838     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
839     void _UTF8_ISO88591_null_ISO88591_null() throws Exception {
840         charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.ISO88591, null);
841     }
842 
843     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
844     void _UTF8_UTF8_ISO88591_ISO88591_null() throws Exception {
845         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null);
846     }
847 
848     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
849     void _UTF8_null_ISO88591_ISO88591_null() throws Exception {
850         charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.ISO88591, null);
851     }
852 
853     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
854     void _UTF8_null_UTF8_ISO88591_null() throws Exception {
855         charset(TestCharset.UTF8, null, TestCharset.UTF8, TestCharset.ISO88591, null);
856     }
857 
858     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
859     void _UTF8_null_null_ISO88591_null() throws Exception {
860         charset(TestCharset.UTF8, null, null, TestCharset.ISO88591, null);
861     }
862 
863     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
864     void _null_ISO88591_ISO88591_ISO88591_null() throws Exception {
865         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null);
866     }
867 
868     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
869     void _null_ISO88591_UTF8_ISO88591_null() throws Exception {
870         charset(null, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null);
871     }
872 
873     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
874     void _null_ISO88591_null_ISO88591_null() throws Exception {
875         charset(null, TestCharset.ISO88591, null, TestCharset.ISO88591, null);
876     }
877 
878     @Alerts({"\"a\"", "\"�\"", "\"?????\"", "\"???\"", "\"??\""})
879     void _null_UTF8_ISO88591_ISO88591_null() throws Exception {
880         charset(null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null);
881     }
882 
883     @Alerts({"\"a\"", "\"ä\"", "\"?????\"", "\"???\"", "\"??\""})
884     void _null_null_ISO88591_ISO88591_null() throws Exception {
885         charset(null, null, TestCharset.ISO88591, TestCharset.ISO88591, null);
886     }
887 
888     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
889     void _null_null_UTF8_ISO88591_null() throws Exception {
890         charset(null, null, TestCharset.UTF8, TestCharset.ISO88591, null);
891     }
892 
893     @Alerts({"\"a\"", "\"ä\"", "\"أهلاً\"", "\"мир\"", "\"房间\""})
894     void _null_null_null_ISO88591_null() throws Exception {
895         charset(null, null, null, TestCharset.ISO88591, null);
896     }
897 }