1--TEST--
2Exhaustive test of verification and conversion of CP949 (UHC) 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');
12testEncodingFromUTF16ConversionTable(__DIR__ . '/data/CP949.txt', 'UHC');
13
14// Regression test
15convertInvalidString("\xE4\xA4\xB4<", "\x75\x1A\x00%", "UHC", "UTF-16BE");
16
17// When optimizing performance of CP949 conversion, I accidentally broke the
18// case where 0xC9 appears before a valid character which starts with a
19// byte lower than 0xA1
20convertInvalidString("\xC9\x9E\x98", "%\xEC\x98\x92", "UHC", "UTF-8");
21
22// Test "long" illegal character markers
23mb_substitute_character("long");
24convertInvalidString("\x80", "%", "UHC", "UTF-8");
25convertInvalidString("\xA7\xF0", "%", "UHC", "UTF-8");
26?>
27--EXPECT--
28Tested UHC -> UTF-16BE
29Tested UTF-16BE -> UHC
30