1--TEST--
2Test verification and conversion of UCS-2 text
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7include('encoding_tests.inc');
8mb_substitute_character(0x25);
9
10testValidString("\xFF\xFE\x00\x30", "\x30\x00", "UCS-2", "UTF-16BE", false);
11testValidString("\xFE\xFF\x30\x00", "\x30\x00", "UCS-2", "UTF-16BE", false);
12testValidString("\x30\x00", "\x30\x00", "UCS-2", "UTF-16BE");
13testValidString("\x00\x30", "\x30\x00", "UCS-2LE", "UTF-16BE");
14
15// Test "long" illegal character markers
16mb_substitute_character("long");
17
18convertInvalidString("\x00\x01\x02\x03", "\x00U\x00+\x001\x000\x002\x000\x003", "UTF-32BE", "UCS-2BE");
19convertInvalidString("\x11", "%", "UCS-2BE", "UTF-8");
20
21convertInvalidString("\x00\x01\x02\x03", "U\x00+\x001\x000\x002\x000\x003\x00", "UTF-32BE", "UCS-2LE");
22convertInvalidString("\x11", "%", "UCS-2LE", "UTF-8");
23
24echo "Done!";
25?>
26--EXPECT--
27Done!
28