1--TEST--
2mb_substitute_character()
3--SKIPIF--
4<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5--FILE--
6<?php
7//$debug = true;
8ini_set('include_path', dirname(__FILE__));
9include_once('common.inc');
10
11// Note: It does not return TRUE/FALSE for setting char
12
13var_dump(mb_substitute_character(0x3044));
14var_dump(mb_substitute_character());
15var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
16
17var_dump(mb_substitute_character('long'));
18var_dump(mb_substitute_character());
19var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
20
21var_dump(mb_substitute_character('none'));
22var_dump(mb_substitute_character());
23var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
24
25var_dump(mb_substitute_character('entity'));
26var_dump(mb_substitute_character());
27var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
28
29var_dump(mb_substitute_character('BAD_NAME'));
30?>
31--EXPECT--
32bool(true)
33int(12356)
34string(8) "82a282a0"
35bool(true)
36string(4) "long"
37string(16) "552b3236363082a0"
38bool(true)
39string(4) "none"
40string(4) "82a0"
41bool(true)
42string(6) "entity"
43string(20) "262378323636303b82a0"
44ERR: Warning
45bool(false)
46