1--TEST--
2Test mb_substitute_character() function : variation unmappable out char for convert encoding
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7echo "*** Testing mb_substitute_character() : variation ***\n";
8//japanese utf-8
9$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI');
10
11//output the default which is ? in ISO-8859-1, x3f
12var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
13
14mb_substitute_character(66);  //'B' in ISO-8859-1, x42
15var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
16mb_substitute_character("none"); //no substitution
17var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
18mb_substitute_character(280); //not valid in ISO-8859-1
19var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
20
21
22?>
23--EXPECT--
24*** Testing mb_substitute_character() : variation ***
25string(14) "3f3f3f3f3f3f3f"
26string(14) "42424242424242"
27string(0) ""
28string(14) "3f3f3f3f3f3f3f"
29