1--TEST--
2Exhaustive test of verification and conversion of ISO-8859-X text
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
8?>
9--FILE--
10<?php
11include('encoding_tests.inc');
12
13for ($n = 1; $n <= 16; $n++) {
14    if ($n == 11 || $n == 12)
15        continue;
16    testEncodingFromUTF16ConversionTable(__DIR__ . "/data/8859-$n.txt", "ISO-8859-{$n}");
17}
18
19// Test "long" illegal character markers
20mb_substitute_character("long");
21convertInvalidString("\xAE", "%", "ISO8859-7", "UTF-8");
22convertInvalidString("\xFF", "%", "ISO8859-8", "UTF-8");
23
24// Test illegal character marker which can't be represented in target encoding
25mb_substitute_character(0x1234);
26convertInvalidString("\x23\x45", '?', 'UTF-16BE', 'ISO8859-7');
27
28echo "Done!\n";
29?>
30--EXPECT--
31Tested ISO-8859-1 -> UTF-16BE
32Tested UTF-16BE -> ISO-8859-1
33Tested ISO-8859-2 -> UTF-16BE
34Tested UTF-16BE -> ISO-8859-2
35Tested ISO-8859-3 -> UTF-16BE
36Tested UTF-16BE -> ISO-8859-3
37Tested ISO-8859-4 -> UTF-16BE
38Tested UTF-16BE -> ISO-8859-4
39Tested ISO-8859-5 -> UTF-16BE
40Tested UTF-16BE -> ISO-8859-5
41Tested ISO-8859-6 -> UTF-16BE
42Tested UTF-16BE -> ISO-8859-6
43Tested ISO-8859-7 -> UTF-16BE
44Tested UTF-16BE -> ISO-8859-7
45Tested ISO-8859-8 -> UTF-16BE
46Tested UTF-16BE -> ISO-8859-8
47Tested ISO-8859-9 -> UTF-16BE
48Tested UTF-16BE -> ISO-8859-9
49Tested ISO-8859-10 -> UTF-16BE
50Tested UTF-16BE -> ISO-8859-10
51Tested ISO-8859-13 -> UTF-16BE
52Tested UTF-16BE -> ISO-8859-13
53Tested ISO-8859-14 -> UTF-16BE
54Tested UTF-16BE -> ISO-8859-14
55Tested ISO-8859-15 -> UTF-16BE
56Tested UTF-16BE -> ISO-8859-15
57Tested ISO-8859-16 -> UTF-16BE
58Tested UTF-16BE -> ISO-8859-16
59Done!
60