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  import static org.junit.jupiter.api.Assertions.assertArrayEquals;
20  
21  import java.io.ByteArrayOutputStream;
22  import java.net.URL;
23  import java.nio.charset.Charset;
24  import java.nio.charset.StandardCharsets;
25  import java.util.ArrayList;
26  import java.util.Collection;
27  import java.util.List;
28  import java.util.zip.GZIPOutputStream;
29  
30  import org.apache.commons.io.ByteOrderMark;
31  import org.apache.commons.lang3.ArrayUtils;
32  import org.htmlunit.MiniServer;
33  import org.htmlunit.WebDriverTestCase;
34  import org.htmlunit.WebTestCase;
35  import org.htmlunit.html.HtmlScript;
36  import org.htmlunit.junit.annotation.Alerts;
37  import org.htmlunit.junit.annotation.HtmlUnitNYI;
38  import org.htmlunit.util.MimeType;
39  import org.htmlunit.util.NameValuePair;
40  import org.junit.jupiter.params.ParameterizedTest;
41  import org.junit.jupiter.params.provider.Arguments;
42  import org.junit.jupiter.params.provider.MethodSource;
43  import org.openqa.selenium.JavascriptExecutor;
44  import org.openqa.selenium.WebDriver;
45  import org.openqa.selenium.WebDriverException;
46  
47  /**
48   * Tests encoding handling for {@link HtmlScript}.
49   *
50   * @author Ronald Brill
51   */
52  public class ScriptEncodingTest extends WebDriverTestCase {
53  
54      private static final String BOM_UTF_16LE = "BOMUTF16LE";
55      private static final String BOM_UTF_16BE = "BOMUTF16BE";
56      private static final String BOM_UTF_8 = "BOMUTF8";
57  
58      private enum TestCharset {
59          UTF8("UTF8", UTF_8),
60          ISO88591("ISO88591", ISO_8859_1),
61          GB2312("GB2312", Charset.forName("GB2312"));
62  
63          private final String label_;
64          private final Charset charset_;
65  
66          TestCharset(final String label, final Charset charset) {
67              label_ = label;
68              charset_ = charset;
69          }
70  
71          @Override
72          public String toString() {
73              return label_;
74          }
75  
76          public Charset getCharset() {
77              return charset_;
78          }
79      }
80  
81      /**
82       * Returns the parameterized data.
83       * @return the parameterized data
84       * @throws Exception if an error occurs
85       */
86      public static Collection<Arguments> data() throws Exception {
87          final List<Arguments> list = new ArrayList<>();
88  
89          final TestCharset[] charsetHtmlResponseHeader =
90                  new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.GB2312};
91          final TestCharset[] charsetAttribute = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
92          final TestCharset[] charsetResponseHeader = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
93          final TestCharset[] charsetResponseEncoding = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
94          final String[] bom = {null, BOM_UTF_8, BOM_UTF_16LE, BOM_UTF_16BE};
95  
96          for (final Object charsetHtml : charsetHtmlResponseHeader) {
97              for (final Object attribute : charsetAttribute) {
98                  for (final Object responseHeader : charsetResponseHeader) {
99                      for (final Object responseEncoding : charsetResponseEncoding) {
100                         for (final Object b : bom) {
101                             list.add(Arguments.of(charsetHtml, attribute, responseHeader, responseEncoding, b, false));
102                             list.add(Arguments.of(charsetHtml, attribute, responseHeader, responseEncoding, b, true));
103                         }
104                     }
105                 }
106             }
107         }
108         return list;
109     }
110 
111     /**
112      * The default test.
113      * @throws Exception if an error occurs
114      */
115     @ParameterizedTest(name = "_{0}_{1}_{2}_{3}_{4}_{5}")
116     @MethodSource("data")
117     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
118     void charset(
119             final TestCharset charsetHtmlResponse,
120             final TestCharset charsetAttribute,
121             final TestCharset charsetResponseHeader,
122             final TestCharset charsetResponseEncoding,
123             final String bom,
124             final boolean gzip) throws Exception {
125 
126         // use always a different url to avoid caching effects
127         final URL scriptUrl = new URL(URL_SECOND, "" + System.currentTimeMillis() + ".js");
128 
129         String html = DOCTYPE_HTML
130             + "<html><head>\n"
131             + "  <script>var logMsg = ''; function log(msg) { logMsg += msg + '\\xA7\\xA7'; }</script>\n"
132             + "  <script type='text/javascript'>window.onerror=function(msg) { log(msg); }</script>"
133             + "  <script src='" + scriptUrl + "'";
134         if (charsetAttribute != null) {
135             html = html + " charset='" + charsetAttribute.getCharset().name().toLowerCase() + "'";
136         }
137         html = html + "></script>\n"
138             + "</head>\n"
139             + "<body>\n"
140             + "</body>\n"
141             + "</html>";
142 
143         String scriptContentType = MimeType.TEXT_JAVASCRIPT;
144         if (charsetResponseHeader != null) {
145             scriptContentType = scriptContentType + "; charset="
146                                     + charsetResponseHeader.getCharset().name().toLowerCase();
147         }
148         final String js = "log('a'); log('ä'); log('أهلاً'); log('мир'); log('房间');";
149 
150         byte[] script = null;
151         if (charsetResponseEncoding == null) {
152             script = js.getBytes(UTF_8);
153         }
154         else {
155             script = js.getBytes(charsetResponseEncoding.getCharset());
156         }
157 
158         if (BOM_UTF_8.equals(bom)) {
159             script = ArrayUtils.addAll(ByteOrderMark.UTF_8.getBytes(), js.getBytes(StandardCharsets.UTF_8));
160         }
161         else if (BOM_UTF_16BE.equals(bom)) {
162             script = ArrayUtils.addAll(ByteOrderMark.UTF_16BE.getBytes(), js.getBytes(StandardCharsets.UTF_16BE));
163         }
164         else if (BOM_UTF_16LE.equals(bom)) {
165             script = ArrayUtils.addAll(ByteOrderMark.UTF_16LE.getBytes(), js.getBytes(StandardCharsets.UTF_16LE));
166         }
167         if (gzip) {
168             final ByteArrayOutputStream bos = new ByteArrayOutputStream();
169             final GZIPOutputStream gout = new GZIPOutputStream(bos);
170             gout.write(script);
171             gout.finish();
172 
173             final List<NameValuePair> headers = new ArrayList<>();
174             headers.add(new NameValuePair("Content-Encoding", "gzip"));
175             getMockWebConnection().setResponse(scriptUrl, bos.toByteArray(), 200, "OK", scriptContentType, headers);
176         }
177         else {
178             getMockWebConnection().setResponse(scriptUrl, script, 200, "OK", scriptContentType, null);
179         }
180 
181         String htmlContentType = MimeType.TEXT_HTML;
182         Charset htmlResponseCharset = ISO_8859_1;
183         if (charsetHtmlResponse != null) {
184             htmlContentType = htmlContentType + "; charset=" + charsetHtmlResponse.getCharset().name();
185             htmlResponseCharset = charsetHtmlResponse.getCharset();
186         }
187 
188         getMockWebConnection().setResponse(URL_FIRST,
189                 html.getBytes(htmlResponseCharset), 200, "OK", htmlContentType, null);
190 
191         expandExpectedAlertsVariables(URL_FIRST);
192         final String[] expectedAlerts = getExpectedAlerts();
193 
194 
195 
196         try (MiniServer miniServer1 = new MiniServer(PORT, getMockWebConnection())) {
197             miniServer1.start();
198 
199             try {
200                 final WebDriver driver = getWebDriver();
201                 driver.get(WebTestCase.URL_FIRST.toExternalForm());
202 
203                 final String logMsg = (String) ((JavascriptExecutor) driver).executeScript("return logMsg;");
204                 final String[] actualAlerts = logMsg.split("§§");
205 
206                 if (actualAlerts.length == 1) {
207                     assertEquals(1, actualAlerts.length);
208 
209                     final String msg = actualAlerts[0];
210                     assertEquals(expectedAlerts[0], "Invalid token");
211                     assertTrue(msg, msg.contains("Invalid or unexpected token")
212                                     || msg.contains("illegal character")
213                                     || msg.contains("Ungültiges Zeichen"));
214                 }
215                 else {
216                     assertArrayEquals(getExpectedAlerts(), actualAlerts);
217                 }
218             }
219             catch (final WebDriverException e) {
220                 if (!e.getCause().getMessage().contains("illegal character")
221                     && !e.getCause().getMessage().contains("is not defined.")) {
222                     throw e;
223                 }
224 
225                 assertTrue(expectedAlerts.length == 1);
226                 final String msg = e.getCause().getMessage();
227                 assertTrue(msg, msg.contains(expectedAlerts[0]));
228             }
229         }
230     }
231 
232     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
233     void _ISO88591_null_null_null_null_false() throws Exception {
234         charset(TestCharset.ISO88591, null, null, null, null, false);
235     }
236 
237     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
238     void _ISO88591_null_null_null_null_true() throws Exception {
239         charset(TestCharset.ISO88591, null, null, null, null, true);
240     }
241 
242     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
243     void _ISO88591_null_null_UTF8_null_false() throws Exception {
244         charset(TestCharset.ISO88591, null, null, TestCharset.UTF8, null, false);
245     }
246 
247     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
248     void _ISO88591_null_null_UTF8_null_true() throws Exception {
249         charset(TestCharset.ISO88591, null, null, TestCharset.UTF8, null, true);
250     }
251 
252     @Alerts({"a", "ä", "?????", "???", "??"})
253     void _ISO88591_null_null_ISO88591_null_false() throws Exception {
254         charset(TestCharset.ISO88591, null, null, TestCharset.ISO88591, null, false);
255     }
256 
257     @Alerts({"a", "ä", "?????", "???", "??"})
258     void _ISO88591_null_null_ISO88591_null_true() throws Exception {
259         charset(TestCharset.ISO88591, null, null, TestCharset.ISO88591, null, true);
260     }
261 
262     @Alerts({"a", "�", "?????", "???", "??"})
263     void _ISO88591_null_UTF8_ISO88591_null_false() throws Exception {
264         charset(TestCharset.ISO88591, null, TestCharset.UTF8, TestCharset.ISO88591, null, false);
265     }
266 
267     @Alerts({"a", "�", "?????", "???", "??"})
268     void _ISO88591_null_UTF8_ISO88591_null_true() throws Exception {
269         charset(TestCharset.ISO88591, null, TestCharset.UTF8, TestCharset.ISO88591, null, true);
270     }
271 
272     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
273     void _ISO88591_null_ISO88591_null_null_false() throws Exception {
274         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, null, null, false);
275     }
276 
277     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
278     void _ISO88591_null_ISO88591_null_null_true() throws Exception {
279         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, null, null, true);
280     }
281 
282     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
283     void _ISO88591_null_ISO88591_UTF8_null_false() throws Exception {
284         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, TestCharset.UTF8, null, false);
285     }
286 
287     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
288     void _ISO88591_null_ISO88591_UTF8_null_true() throws Exception {
289         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, TestCharset.UTF8, null, true);
290     }
291 
292     @Alerts({"a", "ä", "?????", "???", "??"})
293     void _ISO88591_null_ISO88591_ISO88591_null_false() throws Exception {
294         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
295     }
296 
297     @Alerts({"a", "ä", "?????", "???", "??"})
298     void _ISO88591_null_ISO88591_ISO88591_null_true() throws Exception {
299         charset(TestCharset.ISO88591, null, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
300     }
301 
302     @Alerts({"a", "�", "?????", "???", "??"})
303     void _ISO88591_UTF8_null_ISO88591_null_false() throws Exception {
304         charset(TestCharset.ISO88591, TestCharset.UTF8, null, TestCharset.ISO88591, null, false);
305     }
306 
307     @Alerts({"a", "�", "?????", "???", "??"})
308     void _ISO88591_UTF8_null_ISO88591_null_true() throws Exception {
309         charset(TestCharset.ISO88591, TestCharset.UTF8, null, TestCharset.ISO88591, null, true);
310     }
311 
312     @Alerts({"a", "�", "?????", "???", "??"})
313     void _ISO88591_UTF8_UTF8_ISO88591_null_false() throws Exception {
314         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, false);
315     }
316 
317     @Alerts({"a", "�", "?????", "???", "??"})
318     void _ISO88591_UTF8_UTF8_ISO88591_null_true() throws Exception {
319         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, true);
320     }
321 
322     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
323     void _ISO88591_UTF8_ISO88591_null_null_false() throws Exception {
324         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, null, false);
325     }
326 
327     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
328     void _ISO88591_UTF8_ISO88591_null_null_true() throws Exception {
329         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, null, true);
330     }
331 
332     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
333     void _ISO88591_UTF8_ISO88591_UTF8_null_false() throws Exception {
334         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, false);
335     }
336 
337     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
338     void _ISO88591_UTF8_ISO88591_UTF8_null_true() throws Exception {
339         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, true);
340     }
341 
342     @Alerts({"a", "ä", "?????", "???", "??"})
343     void _ISO88591_UTF8_ISO88591_ISO88591_null_false() throws Exception {
344         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
345     }
346 
347     @Alerts({"a", "ä", "?????", "???", "??"})
348     void _ISO88591_UTF8_ISO88591_ISO88591_null_true() throws Exception {
349         charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
350     }
351 
352     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
353     void _ISO88591_ISO88591_null_null_null_false() throws Exception {
354         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, null, null, false);
355     }
356 
357     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
358     void _ISO88591_ISO88591_null_null_null_true() throws Exception {
359         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, null, null, true);
360     }
361 
362     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
363     void _ISO88591_ISO88591_null_UTF8_null_false() throws Exception {
364         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, TestCharset.UTF8, null, false);
365     }
366 
367     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
368     void _ISO88591_ISO88591_null_UTF8_null_true() throws Exception {
369         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, TestCharset.UTF8, null, true);
370     }
371 
372     @Alerts({"a", "ä", "?????", "???", "??"})
373     void _ISO88591_ISO88591_null_ISO88591_null_false() throws Exception {
374         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, TestCharset.ISO88591, null, false);
375     }
376 
377     @Alerts({"a", "ä", "?????", "???", "??"})
378     void _ISO88591_ISO88591_null_ISO88591_null_true() throws Exception {
379         charset(TestCharset.ISO88591, TestCharset.ISO88591, null, TestCharset.ISO88591, null, true);
380     }
381 
382     @Alerts({"a", "�", "?????", "???", "??"})
383     void _ISO88591_ISO88591_UTF8_ISO88591_null_false() throws Exception {
384         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, false);
385     }
386 
387     @Alerts({"a", "�", "?????", "???", "??"})
388     void _ISO88591_ISO88591_UTF8_ISO88591_null_true() throws Exception {
389         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, true);
390     }
391 
392     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
393     void _ISO88591_ISO88591_ISO88591_null_null_false() throws Exception {
394         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, null, false);
395     }
396 
397     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
398     void _ISO88591_ISO88591_ISO88591_null_null_true() throws Exception {
399         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, null, true);
400     }
401 
402     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
403     void _ISO88591_ISO88591_ISO88591_UTF8_null_false() throws Exception {
404         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, false);
405     }
406 
407     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
408     void _ISO88591_ISO88591_ISO88591_UTF8_null_true() throws Exception {
409         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, true);
410     }
411 
412     @Alerts({"a", "ä", "?????", "???", "??"})
413     void _ISO88591_ISO88591_ISO88591_ISO88591_null_false() throws Exception {
414         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
415     }
416 
417     @Alerts({"a", "ä", "?????", "???", "??"})
418     void _ISO88591_ISO88591_ISO88591_ISO88591_null_true() throws Exception {
419         charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
420     }
421 
422     @Alerts({"a", "ä", "?????", "???", "??"})
423     void _UTF8_ISO88591_ISO88591_ISO88591_null_false() throws Exception {
424         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
425     }
426 
427     @Alerts({"a", "ä", "?????", "???", "??"})
428     void _UTF8_ISO88591_ISO88591_ISO88591_null_true() throws Exception {
429         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
430     }
431 
432     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
433     void _UTF8_ISO88591_ISO88591_UTF8_null_false() throws Exception {
434         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, false);
435     }
436 
437     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
438     void _UTF8_ISO88591_ISO88591_UTF8_null_true() throws Exception {
439         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, true);
440     }
441 
442     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
443     void _UTF8_ISO88591_ISO88591_null_null_false() throws Exception {
444         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, null, false);
445     }
446 
447     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
448     void _UTF8_ISO88591_ISO88591_null_null_true() throws Exception {
449         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, null, true);
450     }
451 
452     @Alerts({"a", "�", "?????", "???", "??"})
453     void _UTF8_ISO88591_UTF8_ISO88591_null_false() throws Exception {
454         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, false);
455     }
456 
457     @Alerts({"a", "�", "?????", "???", "??"})
458     void _UTF8_ISO88591_UTF8_ISO88591_null_true() throws Exception {
459         charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, true);
460     }
461 
462     @Alerts({"a", "ä", "?????", "???", "??"})
463     void _UTF8_ISO88591_null_ISO88591_null_false() throws Exception {
464         charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.ISO88591, null, false);
465     }
466 
467     @Alerts({"a", "ä", "?????", "???", "??"})
468     void _UTF8_ISO88591_null_ISO88591_null_true() throws Exception {
469         charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.ISO88591, null, true);
470     }
471 
472     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
473     void _UTF8_ISO88591_null_UTF8_null_false() throws Exception {
474         charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.UTF8, null, false);
475     }
476 
477     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
478     void _UTF8_ISO88591_null_UTF8_null_true() throws Exception {
479         charset(TestCharset.UTF8, TestCharset.ISO88591, null, TestCharset.UTF8, null, true);
480     }
481 
482     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
483     void _UTF8_ISO88591_null_null_null_false() throws Exception {
484         charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, null, false);
485     }
486 
487     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
488     void _UTF8_ISO88591_null_null_null_true() throws Exception {
489         charset(TestCharset.UTF8, TestCharset.ISO88591, null, null, null, true);
490     }
491 
492     @Alerts({"a", "ä", "?????", "???", "??"})
493     void _UTF8_UTF8_ISO88591_ISO88591_null_false() throws Exception {
494         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
495     }
496 
497     @Alerts({"a", "ä", "?????", "???", "??"})
498     void _UTF8_UTF8_ISO88591_ISO88591_null_true() throws Exception {
499         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
500     }
501 
502     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
503     void _UTF8_UTF8_ISO88591_UTF8_null_false() throws Exception {
504         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, false);
505     }
506 
507     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
508     void _UTF8_UTF8_ISO88591_UTF8_null_true() throws Exception {
509         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, true);
510     }
511 
512     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
513     void _UTF8_UTF8_ISO88591_null_null_false() throws Exception {
514         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, null, false);
515     }
516 
517     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
518     void _UTF8_UTF8_ISO88591_null_null_true() throws Exception {
519         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, null, true);
520     }
521 
522     @Alerts({"a", "�", "?????", "???", "??"})
523     void _UTF8_UTF8_UTF8_ISO88591_null_false() throws Exception {
524         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, false);
525     }
526 
527     @Alerts({"a", "�", "?????", "???", "??"})
528     void _UTF8_UTF8_UTF8_ISO88591_null_true() throws Exception {
529         charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, true);
530     }
531 
532     @Alerts({"a", "�", "?????", "???", "??"})
533     void _UTF8_UTF8_null_ISO88591_null_false() throws Exception {
534         charset(TestCharset.UTF8, TestCharset.UTF8, null, TestCharset.ISO88591, null, false);
535     }
536 
537     @Alerts({"a", "�", "?????", "???", "??"})
538     void _UTF8_UTF8_null_ISO88591_null_true() throws Exception {
539         charset(TestCharset.UTF8, TestCharset.UTF8, null, TestCharset.ISO88591, null, true);
540     }
541 
542     @Alerts({"a", "ä", "?????", "???", "??"})
543     void _UTF8_null_ISO88591_ISO88591_null_false() throws Exception {
544         charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
545     }
546 
547     @Alerts({"a", "ä", "?????", "???", "??"})
548     void _UTF8_null_ISO88591_ISO88591_null_true() throws Exception {
549         charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
550     }
551 
552     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
553     void _UTF8_null_ISO88591_UTF8_null_false() throws Exception {
554         charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.UTF8, null, false);
555     }
556 
557     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
558     void _UTF8_null_ISO88591_UTF8_null_true() throws Exception {
559         charset(TestCharset.UTF8, null, TestCharset.ISO88591, TestCharset.UTF8, null, true);
560     }
561 
562     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
563     void _UTF8_null_ISO88591_null_null_false() throws Exception {
564         charset(TestCharset.UTF8, null, TestCharset.ISO88591, null, null, false);
565     }
566 
567     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
568     void _UTF8_null_ISO88591_null_null_true() throws Exception {
569         charset(TestCharset.UTF8, null, TestCharset.ISO88591, null, null, true);
570     }
571 
572     @Alerts({"a", "�", "?????", "???", "??"})
573     void _UTF8_null_UTF8_ISO88591_null_false() throws Exception {
574         charset(TestCharset.UTF8, null, TestCharset.UTF8, TestCharset.ISO88591, null, false);
575     }
576 
577     @Alerts({"a", "�", "?????", "???", "??"})
578     void _UTF8_null_UTF8_ISO88591_null_true() throws Exception {
579         charset(TestCharset.UTF8, null, TestCharset.UTF8, TestCharset.ISO88591, null, true);
580     }
581 
582     @Alerts({"a", "�", "?????", "???", "??"})
583     void _UTF8_null_null_ISO88591_null_false() throws Exception {
584         charset(TestCharset.UTF8, null, null, TestCharset.ISO88591, null, false);
585     }
586 
587     @Alerts({"a", "�", "?????", "???", "??"})
588     void _UTF8_null_null_ISO88591_null_true() throws Exception {
589         charset(TestCharset.UTF8, null, null, TestCharset.ISO88591, null, true);
590     }
591 
592     @Alerts({"a", "ä", "?????", "???", "??"})
593     void _null_ISO88591_ISO88591_ISO88591_null_false() throws Exception {
594         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
595     }
596 
597     @Alerts({"a", "ä", "?????", "???", "??"})
598     void _null_ISO88591_ISO88591_ISO88591_null_true() throws Exception {
599         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
600     }
601 
602     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
603     void _null_ISO88591_ISO88591_UTF8_null_false() throws Exception {
604         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, false);
605     }
606 
607     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
608     void _null_ISO88591_ISO88591_UTF8_null_true() throws Exception {
609         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, true);
610     }
611 
612     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
613     void _null_ISO88591_ISO88591_null_null_false() throws Exception {
614         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, null, null, false);
615     }
616 
617     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
618     void _null_ISO88591_ISO88591_null_null_true() throws Exception {
619         charset(null, TestCharset.ISO88591, TestCharset.ISO88591, null, null, true);
620     }
621 
622     @Alerts({"a", "�", "?????", "???", "??"})
623     void _null_ISO88591_UTF8_ISO88591_null_false() throws Exception {
624         charset(null, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, false);
625     }
626 
627     @Alerts({"a", "�", "?????", "???", "??"})
628     void _null_ISO88591_UTF8_ISO88591_null_true() throws Exception {
629         charset(null, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, true);
630     }
631 
632     @Alerts({"a", "ä", "?????", "???", "??"})
633     void _null_ISO88591_null_ISO88591_null_false() throws Exception {
634         charset(null, TestCharset.ISO88591, null, TestCharset.ISO88591, null, false);
635     }
636 
637     @Alerts({"a", "ä", "?????", "???", "??"})
638     void _null_ISO88591_null_ISO88591_null_true() throws Exception {
639         charset(null, TestCharset.ISO88591, null, TestCharset.ISO88591, null, true);
640     }
641 
642     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
643     void _null_ISO88591_null_UTF8_null_false() throws Exception {
644         charset(null, TestCharset.ISO88591, null, TestCharset.UTF8, null, false);
645     }
646 
647     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
648     void _null_ISO88591_null_UTF8_null_true() throws Exception {
649         charset(null, TestCharset.ISO88591, null, TestCharset.UTF8, null, true);
650     }
651 
652     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
653     void _null_ISO88591_null_null_null_false() throws Exception {
654         charset(null, TestCharset.ISO88591, null, null, null, false);
655     }
656 
657     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
658     void _null_ISO88591_null_null_null_true() throws Exception {
659         charset(null, TestCharset.ISO88591, null, null, null, true);
660     }
661 
662     @Alerts({"a", "ä", "?????", "???", "??"})
663     void _null_UTF8_ISO88591_ISO88591_null_false() throws Exception {
664         charset(null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
665     }
666 
667     @Alerts({"a", "ä", "?????", "???", "??"})
668     void _null_UTF8_ISO88591_ISO88591_null_true() throws Exception {
669         charset(null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
670     }
671 
672     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
673     void _null_UTF8_ISO88591_UTF8_null_false() throws Exception {
674         charset(null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, false);
675     }
676 
677     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
678     void _null_UTF8_ISO88591_UTF8_null_true() throws Exception {
679         charset(null, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, true);
680     }
681 
682     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
683     void _null_UTF8_ISO88591_null_null_false() throws Exception {
684         charset(null, TestCharset.UTF8, TestCharset.ISO88591, null, null, false);
685     }
686 
687     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
688     void _null_UTF8_ISO88591_null_null_true() throws Exception {
689         charset(null, TestCharset.UTF8, TestCharset.ISO88591, null, null, true);
690     }
691 
692     @Alerts({"a", "�", "?????", "???", "??"})
693     void _null_UTF8_UTF8_ISO88591_null_false() throws Exception {
694         charset(null, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, false);
695     }
696 
697     @Alerts({"a", "�", "?????", "???", "??"})
698     void _null_UTF8_UTF8_ISO88591_null_true() throws Exception {
699         charset(null, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, true);
700     }
701 
702     @Alerts({"a", "�", "?????", "???", "??"})
703     void _null_UTF8_null_ISO88591_null_false() throws Exception {
704         charset(null, TestCharset.UTF8, null, TestCharset.ISO88591, null, false);
705     }
706 
707     @Alerts({"a", "�", "?????", "???", "??"})
708     void _null_UTF8_null_ISO88591_null_true() throws Exception {
709         charset(null, TestCharset.UTF8, null, TestCharset.ISO88591, null, true);
710     }
711 
712     @Alerts({"a", "ä", "?????", "???", "??"})
713     void _null_null_ISO88591_ISO88591_null_false() throws Exception {
714         charset(null, null, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
715     }
716 
717     @Alerts({"a", "ä", "?????", "???", "??"})
718     void _null_null_ISO88591_ISO88591_null_true() throws Exception {
719         charset(null, null, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
720     }
721 
722     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
723     void _null_null_ISO88591_UTF8_null_false() throws Exception {
724         charset(null, null, TestCharset.ISO88591, TestCharset.UTF8, null, false);
725     }
726 
727     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
728     void _null_null_ISO88591_UTF8_null_true() throws Exception {
729         charset(null, null, TestCharset.ISO88591, TestCharset.UTF8, null, true);
730     }
731 
732     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
733     void _null_null_ISO88591_null_null_false() throws Exception {
734         charset(null, null, TestCharset.ISO88591, null, null, false);
735     }
736 
737     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
738     void _null_null_ISO88591_null_null_true() throws Exception {
739         charset(null, null, TestCharset.ISO88591, null, null, true);
740     }
741 
742     @Alerts({"a", "�", "?????", "???", "??"})
743     void _null_null_UTF8_ISO88591_null_false() throws Exception {
744         charset(null, null, TestCharset.UTF8, TestCharset.ISO88591, null, false);
745     }
746 
747     @Alerts({"a", "�", "?????", "???", "??"})
748     void _null_null_UTF8_ISO88591_null_true() throws Exception {
749         charset(null, null, TestCharset.UTF8, TestCharset.ISO88591, null, true);
750     }
751 
752     @Alerts({"a", "ä", "?????", "???", "??"})
753     void _null_null_null_ISO88591_null_false() throws Exception {
754         charset(null, null, null, TestCharset.ISO88591, null, false);
755     }
756 
757     @Alerts({"a", "ä", "?????", "???", "??"})
758     void _null_null_null_ISO88591_null_true() throws Exception {
759         charset(null, null, null, TestCharset.ISO88591, null, true);
760     }
761 
762     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
763     @HtmlUnitNYI(CHROME = {"a", "ä", "أهلاً", "мир", "房间"},
764             EDGE = {"a", "ä", "أهلاً", "мир", "房间"},
765             FF = {"a", "ä", "أهلاً", "мир", "房间"},
766             FF_ESR = {"a", "ä", "أهلاً", "мир", "房间"})
767     void _null_null_null_UTF8_null_false() throws Exception {
768         charset(null, null, null, TestCharset.UTF8, null, false);
769     }
770 
771     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
772     @HtmlUnitNYI(CHROME = {"a", "ä", "أهلاً", "мир", "房间"},
773             EDGE = {"a", "ä", "أهلاً", "мир", "房间"},
774             FF = {"a", "ä", "أهلاً", "мир", "房间"},
775             FF_ESR = {"a", "ä", "أهلاً", "мир", "房间"})
776     void _null_null_null_UTF8_null_true() throws Exception {
777         charset(null, null, null, TestCharset.UTF8, null, true);
778     }
779 
780     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
781     @HtmlUnitNYI(CHROME = {"a", "ä", "أهلاً", "мир", "房间"},
782             EDGE = {"a", "ä", "أهلاً", "мир", "房间"},
783             FF = {"a", "ä", "أهلاً", "мир", "房间"},
784             FF_ESR = {"a", "ä", "أهلاً", "мир", "房间"})
785     void _null_null_null_null_null_false() throws Exception {
786         charset(null, null, null, null, null, false);
787     }
788 
789     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
790     @HtmlUnitNYI(CHROME = {"a", "ä", "أهلاً", "мир", "房间"},
791             EDGE = {"a", "ä", "أهلاً", "мир", "房间"},
792             FF = {"a", "ä", "أهلاً", "мир", "房间"},
793             FF_ESR = {"a", "ä", "أهلاً", "мир", "房间"})
794     void _null_null_null_null_null_true() throws Exception {
795         charset(null, null, null, null, null, true);
796     }
797 
798     @Alerts({"a", "ä", "?????", "???", "??"})
799     void _GB2312_ISO88591_ISO88591_ISO88591_null_false() throws Exception {
800         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
801     }
802 
803     @Alerts({"a", "ä", "?????", "???", "??"})
804     void _GB2312_ISO88591_ISO88591_ISO88591_null_true() throws Exception {
805         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
806     }
807 
808     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
809     void _GB2312_ISO88591_ISO88591_UTF8_null_false() throws Exception {
810         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, false);
811     }
812 
813     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
814     void _GB2312_ISO88591_ISO88591_UTF8_null_true() throws Exception {
815         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null, true);
816     }
817 
818     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
819     void _GB2312_ISO88591_ISO88591_null_null_false() throws Exception {
820         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, null, null, false);
821     }
822 
823     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
824     void _GB2312_ISO88591_ISO88591_null_null_true() throws Exception {
825         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.ISO88591, null, null, true);
826     }
827 
828     @Alerts({"a", "�", "?????", "???", "??"})
829     void _GB2312_ISO88591_UTF8_ISO88591_null_false() throws Exception {
830         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, false);
831     }
832 
833     @Alerts({"a", "�", "?????", "???", "??"})
834     void _GB2312_ISO88591_UTF8_ISO88591_null_true() throws Exception {
835         charset(TestCharset.GB2312, TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null, true);
836     }
837 
838     @Alerts({"a", "ä", "?????", "???", "??"})
839     void _GB2312_ISO88591_null_ISO88591_null_false() throws Exception {
840         charset(TestCharset.GB2312, TestCharset.ISO88591, null, TestCharset.ISO88591, null, false);
841     }
842 
843     @Alerts({"a", "ä", "?????", "???", "??"})
844     void _GB2312_ISO88591_null_ISO88591_null_true() throws Exception {
845         charset(TestCharset.GB2312, TestCharset.ISO88591, null, TestCharset.ISO88591, null, true);
846     }
847 
848     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
849     void _GB2312_ISO88591_null_UTF8_null_false() throws Exception {
850         charset(TestCharset.GB2312, TestCharset.ISO88591, null, TestCharset.UTF8, null, false);
851     }
852 
853     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
854     void _GB2312_ISO88591_null_UTF8_null_true() throws Exception {
855         charset(TestCharset.GB2312, TestCharset.ISO88591, null, TestCharset.UTF8, null, true);
856     }
857 
858     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
859     void _GB2312_ISO88591_null_null_null_false() throws Exception {
860         charset(TestCharset.GB2312, TestCharset.ISO88591, null, null, null, false);
861     }
862 
863     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
864     void _GB2312_ISO88591_null_null_null_true() throws Exception {
865         charset(TestCharset.GB2312, TestCharset.ISO88591, null, null, null, true);
866     }
867 
868     @Alerts({"a", "ä", "?????", "???", "??"})
869     void _GB2312_UTF8_ISO88591_ISO88591_null_false() throws Exception {
870         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
871     }
872 
873     @Alerts({"a", "ä", "?????", "???", "??"})
874     void _GB2312_UTF8_ISO88591_ISO88591_null_true() throws Exception {
875         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
876     }
877 
878     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
879     void _GB2312_UTF8_ISO88591_UTF8_null_false() throws Exception {
880         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, false);
881     }
882 
883     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
884     void _GB2312_UTF8_ISO88591_UTF8_null_true() throws Exception {
885         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null, true);
886     }
887 
888     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
889     void _GB2312_UTF8_ISO88591_null_null_false() throws Exception {
890         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, null, null, false);
891     }
892 
893     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
894     void _GB2312_UTF8_ISO88591_null_null_true() throws Exception {
895         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.ISO88591, null, null, true);
896     }
897 
898     @Alerts({"a", "�", "?????", "???", "??"})
899     void _GB2312_UTF8_UTF8_ISO88591_null_false() throws Exception {
900         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, false);
901     }
902 
903     @Alerts({"a", "�", "?????", "???", "??"})
904     void _GB2312_UTF8_UTF8_ISO88591_null_true() throws Exception {
905         charset(TestCharset.GB2312, TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null, true);
906     }
907 
908     @Alerts({"a", "�", "?????", "???", "??"})
909     void _GB2312_UTF8_null_ISO88591_null_false() throws Exception {
910         charset(TestCharset.GB2312, TestCharset.UTF8, null, TestCharset.ISO88591, null, false);
911     }
912 
913     @Alerts({"a", "�", "?????", "???", "??"})
914     void _GB2312_UTF8_null_ISO88591_null_true() throws Exception {
915         charset(TestCharset.GB2312, TestCharset.UTF8, null, TestCharset.ISO88591, null, true);
916     }
917 
918     @Alerts({"a", "ä", "?????", "???", "??"})
919     void _GB2312_null_ISO88591_ISO88591_null_false() throws Exception {
920         charset(TestCharset.GB2312, null, TestCharset.ISO88591, TestCharset.ISO88591, null, false);
921     }
922 
923     @Alerts({"a", "ä", "?????", "???", "??"})
924     void _GB2312_null_ISO88591_ISO88591_null_true() throws Exception {
925         charset(TestCharset.GB2312, null, TestCharset.ISO88591, TestCharset.ISO88591, null, true);
926     }
927 
928     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
929     void _GB2312_null_ISO88591_UTF8_null_false() throws Exception {
930         charset(TestCharset.GB2312, null, TestCharset.ISO88591, TestCharset.UTF8, null, false);
931     }
932 
933     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
934     void _GB2312_null_ISO88591_UTF8_null_true() throws Exception {
935         charset(TestCharset.GB2312, null, TestCharset.ISO88591, TestCharset.UTF8, null, true);
936     }
937 
938     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
939     void _GB2312_null_ISO88591_null_null_false() throws Exception {
940         charset(TestCharset.GB2312, null, TestCharset.ISO88591, null, null, false);
941     }
942 
943     @Alerts({"a", "ä", "أهلاً", "мир", "房间"})
944     void _GB2312_null_ISO88591_null_null_true() throws Exception {
945         charset(TestCharset.GB2312, null, TestCharset.ISO88591, null, null, true);
946     }
947 
948     @Alerts({"a", "�", "?????", "???", "??"})
949     void _GB2312_null_UTF8_ISO88591_null_false() throws Exception {
950         charset(TestCharset.GB2312, null, TestCharset.UTF8, TestCharset.ISO88591, null, false);
951     }
952 
953     @Alerts({"a", "�", "?????", "???", "??"})
954     void _GB2312_null_UTF8_ISO88591_null_true() throws Exception {
955         charset(TestCharset.GB2312, null, TestCharset.UTF8, TestCharset.ISO88591, null, true);
956     }
957 
958     @Alerts({"a", "�", "?????", "???", "??"})
959     void _GB2312_null_null_ISO88591_null_false() throws Exception {
960         charset(TestCharset.GB2312, null, null, TestCharset.ISO88591, null, false);
961     }
962 
963     @Alerts({"a", "�", "?????", "???", "??"})
964     void _GB2312_null_null_ISO88591_null_true() throws Exception {
965         charset(TestCharset.GB2312, null, null, TestCharset.ISO88591, null, true);
966     }
967 
968     @Alerts({"a", "盲", "兀賴賱丕賸", "屑懈褉", "鎴块棿"})
969     void _GB2312_null_null_UTF8_null_false() throws Exception {
970         charset(TestCharset.GB2312, null, null, TestCharset.UTF8, null, false);
971     }
972 
973     @Alerts({"a", "盲", "兀賴賱丕賸", "屑懈褉", "鎴块棿"})
974     void _GB2312_null_null_UTF8_null_true() throws Exception {
975         charset(TestCharset.GB2312, null, null, TestCharset.UTF8, null, true);
976     }
977 
978     @Alerts({"a", "盲", "兀賴賱丕賸", "屑懈褉", "鎴块棿"})
979     void _GB2312_null_null_null_null_false() throws Exception {
980         charset(TestCharset.GB2312, null, null, null, null, false);
981     }
982 
983     @Alerts({"a", "盲", "兀賴賱丕賸", "屑懈褉", "鎴块棿"})
984     void _GB2312_null_null_null_null_true() throws Exception {
985         charset(TestCharset.GB2312, null, null, null, null, true);
986     }
987 }