1--TEST--
2mb_convert_encoding() with stateful encodings
3--EXTENSIONS--
4mbstring
5--INI--
6output_handler=
7mbstring.language=Japanese
8--FILE--
9<?php
10echo "ISO-2022-JP empty segment\n";
11echo bin2hex(mb_convert_encoding(pack("H*", "1b24401b24402121"), "UTF-8", "ISO-2022-JP")), "\n";
12echo bin2hex(mb_convert_encoding(pack("H*", "1b24421b24422121"), "UTF-8", "ISO-2022-JP")), "\n";
13echo bin2hex(mb_convert_encoding(pack("H*", "1b28421b284261626364"), "UTF-8", "ISO-2022-JP")), "\n";
14echo bin2hex(mb_convert_encoding(pack("H*", "1b284a1b284a61626364"), "UTF-8", "ISO-2022-JP")), "\n";
15echo bin2hex(mb_convert_encoding(pack("H*", "1b24401b284261626364"), "UTF-8", "ISO-2022-JP")), "\n";
16echo bin2hex(mb_convert_encoding(pack("H*", "1b24401b284a61626364"), "UTF-8", "ISO-2022-JP")), "\n";
17echo bin2hex(mb_convert_encoding(pack("H*", "1b24421b284261626364"), "UTF-8", "ISO-2022-JP")), "\n";
18echo bin2hex(mb_convert_encoding(pack("H*", "1b24421b284a61626364"), "UTF-8", "ISO-2022-JP")), "\n";
19echo "ISO-2022-KR empty segment\n";
20echo bin2hex(mb_convert_encoding(pack("H*", "1b2429430e0f61626364"), "UTF-8", "ISO-2022-KR")), "\n";
21echo "HZ empty segment\n";
22echo bin2hex(mb_convert_encoding(pack("H*", "7e7b7e7d61626364"), "UTF-8", "HZ")), "\n";
23?>
24--EXPECT--
25ISO-2022-JP empty segment
26e38080
27e38080
2861626364
2961626364
3061626364
3161626364
3261626364
3361626364
34ISO-2022-KR empty segment
3561626364
36HZ empty segment
3761626364
38