Home
last modified time | relevance | path

Searched refs:mb_convert_encoding (Results 1 – 25 of 58) sorted by relevance

123

/PHP-8.1/ext/mbstring/tests/
H A Dbug48645.phpt2 Bug #48645 (mb_convert_encoding() doesn't understand hexadecimal html-entities)
7 var_dump(bin2hex(mb_convert_encoding("�", "UTF-8", "HTML-ENTITIES")));
8 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
9 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
10 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
11 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
12 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
13 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
14 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
15 var_dump(bin2hex(mb_convert_encoding("", "UTF-8", "HTML-ENTITIES")));
[all …]
H A Dpictogram1.phpt10 var_dump(bin2hex(mb_convert_encoding("\xf8\x9f", "UCS-4BE", "SJIS-Mobile#DOCOMO")));
11 var_dump(bin2hex(mb_convert_encoding("\xf6\x60", "UCS-4BE", "SJIS-Mobile#KDDI")));
12 var_dump(bin2hex(mb_convert_encoding("\xf9\x8b", "UCS-4BE", "SJIS-Mobile#SOFTBANK")));
14 var_dump(bin2hex(mb_convert_encoding("\xf9\xe6", "UCS-4BE", "SJIS-Mobile#DOCOMO")));
15 var_dump(bin2hex(mb_convert_encoding("\xf6\xec", "UCS-4BE", "SJIS-Mobile#KDDI")));
16 var_dump(bin2hex(mb_convert_encoding("\xf7\x50", "UCS-4BE", "SJIS-Mobile#SOFTBANK")));
18 var_dump(bin2hex(mb_convert_encoding("\xf9\x85", "UCS-4BE", "SJIS-Mobile#DOCOMO")));
19 var_dump(bin2hex(mb_convert_encoding("\xf4\x89", "UCS-4BE", "SJIS-Mobile#KDDI")));
20 var_dump(bin2hex(mb_convert_encoding("\xf7\xb0", "UCS-4BE", "SJIS-Mobile#SOFTBANK")));
22 var_dump(bin2hex(mb_convert_encoding("\xf3\xd2", "UCS-4BE", "SJIS-Mobile#KDDI")));
[all …]
H A Dmb_convert_encoding_array2.phpt2 Test mb_convert_encoding() function : Circular references
8 * Test basic functionality of mb_convert_encoding()
11 echo "*** Testing mb_convert_encoding() : Circular references ***\n";
47 var_dump(base64_encode_array(mb_convert_encoding($sjis_string, 'JIS', 'SJIS')));
49 var_dump(base64_encode_array(mb_convert_encoding($utf8_string, 'JIS', 'UTF-8')));
56 var_dump(base64_encode_array(mb_convert_encoding($jis_string, 'EUC-JP', 'JIS')));
63 var_dump(base64_encode_array(mb_convert_encoding($jis_string, 'SJIS', 'JIS')));
65 var_dump(base64_encode_array(mb_convert_encoding($utf8_string, 'SJIS', 'UTF-8')));
71 var_dump(base64_encode_array(mb_convert_encoding($sjis_string, 'UTF-8', 'SJIS')));
72 var_dump(base64_encode_array(mb_convert_encoding($jis_string, 'UTF-8', 'JIS')));
[all …]
H A Dmb_convert_encoding_stateful.phpt2 mb_convert_encoding() with stateful encodings
11 echo bin2hex(mb_convert_encoding(pack("H*", "1b24401b24402121"), "UTF-8", "ISO-2022-JP")), "\n";
12 echo bin2hex(mb_convert_encoding(pack("H*", "1b24421b24422121"), "UTF-8", "ISO-2022-JP")), "\n";
13 echo bin2hex(mb_convert_encoding(pack("H*", "1b28421b284261626364"), "UTF-8", "ISO-2022-JP")), "\n";
14 echo bin2hex(mb_convert_encoding(pack("H*", "1b284a1b284a61626364"), "UTF-8", "ISO-2022-JP")), "\n";
15 echo bin2hex(mb_convert_encoding(pack("H*", "1b24401b284261626364"), "UTF-8", "ISO-2022-JP")), "\n";
16 echo bin2hex(mb_convert_encoding(pack("H*", "1b24401b284a61626364"), "UTF-8", "ISO-2022-JP")), "\n";
17 echo bin2hex(mb_convert_encoding(pack("H*", "1b24421b284261626364"), "UTF-8", "ISO-2022-JP")), "\n";
18 echo bin2hex(mb_convert_encoding(pack("H*", "1b24421b284a61626364"), "UTF-8", "ISO-2022-JP")), "\n";
20 echo bin2hex(mb_convert_encoding(pack("H*", "1b2429430e0f61626364"), "UTF-8", "ISO-2022-KR")), "\n";
[all …]
H A Dother_encodings.phpt14 var_dump(mb_convert_encoding("ABC", "7bit", "ASCII"));
15 var_dump(mb_convert_encoding("\x80", "7bit", "ASCII"));
16 var_dump(mb_convert_encoding("ABC", "8bit", "7bit"));
25 echo bin2hex(mb_convert_encoding("\xFF\xFE\x00\x30", "UTF-16BE", "UCS-2")), "\n";
26 echo bin2hex(mb_convert_encoding("\xFE\xFF\x30\x00", "UTF-16BE", "UCS-2")), "\n";
27 echo bin2hex(mb_convert_encoding("\x00\x30", "UTF-16BE", "UCS-2LE")), "\n";
31 echo bin2hex(mb_convert_encoding("\xFF\xFE\x00\x00\x00\x30\x00\x00", "UTF-16BE", "UCS-4")), "\n";
32 echo bin2hex(mb_convert_encoding("\x00\x00\xFE\xFF\x00\x00\x30\x01", "UTF-16BE", "UCS-4")), "\n";
33 echo bin2hex(mb_convert_encoding("\x02\x30\x00\x00", "UTF-16BE", "UCS-4LE")), "\n";
34 echo bin2hex(mb_convert_encoding("\x00\x00\x30\x03", "UTF-16BE", "UCS-4BE")), "\n";
[all …]
H A Dmb_convert_encoding_basic.phpt2 Test mb_convert_encoding() function : basic functionality
8 * Test basic functionality of mb_convert_encoding()
11 echo "*** Testing mb_convert_encoding() : basic functionality ***\n";
23 var_dump(base64_encode(mb_convert_encoding($sjis_string, 'JIS', 'SJIS')));
24 var_dump(base64_encode(mb_convert_encoding($euc_jp_string, 'JIS', 'EUC-JP')));
25 var_dump(base64_encode(mb_convert_encoding($utf8_string, 'JIS', 'UTF-8')));
31 var_dump(base64_encode(mb_convert_encoding($sjis_string, 'EUC-JP', 'SJIS')));
32 var_dump(base64_encode(mb_convert_encoding($jis_string, 'EUC-JP', 'JIS')));
39 var_dump(base64_encode(mb_convert_encoding($jis_string, 'SJIS', 'JIS')));
48 var_dump(base64_encode(mb_convert_encoding($jis_string, 'UTF-8', 'JIS')));
[all …]
H A Dmb_convert_encoding.phpt2 mb_convert_encoding()
27 $s = mb_convert_encoding($euc_jp, 'JIS', 'EUC-JP');
39 $s = mb_convert_encoding($s, 'SJIS', $a);
43 $s = mb_convert_encoding($s, 'JIS', $a);
55 $s = mb_convert_encoding($s, 'SJIS', $a);
59 $s = mb_convert_encoding($s, 'JIS', $a);
73 $s = mb_convert_encoding($s, 'SJIS', 'auto');
77 $s = mb_convert_encoding($s, 'JIS', 'auto');
84 $s = mb_convert_encoding(1234, 'EUC-JP');
87 $s = mb_convert_encoding('', 'EUC-JP');
[all …]
H A Dbug79149.phpt2 Bug #79149 (SEGV in mb_convert_encoding with non-string encodings)
8 var_dump(mb_convert_encoding("", "UTF-8", [0]));
13 var_dump(mb_convert_encoding('foo', 'UTF-8', array(['bar'], ['baz'])));
18 var_dump(mb_convert_encoding('foo', 'UTF-8', array("foo\0bar")));
25 mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "0"
28 mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "Array"
29 mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "foo"
H A Dmb_convert_encoding_array.phpt2 Test mb_convert_encoding() function : array functionality
8 * Test basic functionality of mb_convert_encoding()
11 echo "*** Testing mb_convert_encoding() : array functionality ***\n";
35 var_dump(base64_encode_array(mb_convert_encoding($sjis_string, 'JIS', 'SJIS')));
37 var_dump(base64_encode_array(mb_convert_encoding($utf8_string, 'JIS', 'UTF-8')));
43 var_dump(base64_encode_array(mb_convert_encoding($sjis_string, 'EUC-JP', 'SJIS')));
44 var_dump(base64_encode_array(mb_convert_encoding($jis_string, 'EUC-JP', 'JIS')));
51 var_dump(base64_encode_array(mb_convert_encoding($jis_string, 'SJIS', 'JIS')));
53 var_dump(base64_encode_array(mb_convert_encoding($utf8_string, 'SJIS', 'UTF-8')));
60 var_dump(base64_encode_array(mb_convert_encoding($jis_string, 'UTF-8', 'JIS')));
[all …]
H A Dmb_convert_encoding_empty_encoding_list.phpt2 Test mb_convert_encoding() function : empty encoding list
11 var_dump( mb_convert_encoding($string, 'UTF-8', ''));
16 var_dump( mb_convert_encoding($string, 'UTF-8', []));
23 mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding
24 mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding
H A Dgh10627.phpt2 GH-10627 (mb_convert_encoding crashes PHP on Windows)
10 var_dump(mb_convert_encoding($data, 'UTF-8', 'auto'));
12 var_dump(mb_convert_encoding($data, 'UTF-8', 'auto'));
16 Warning: mb_convert_encoding(): Unable to detect character encoding in %s on line %d
22 Warning: mb_convert_encoding(): Unable to detect character encoding in %s on line %d
H A Dbug49528.phpt7 var_dump(bin2hex(mb_convert_encoding("\xff\xfe\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
8 var_dump(bin2hex(mb_convert_encoding("\xfe\xff\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
9 var_dump(bin2hex(mb_convert_encoding("\xff\xfe\xff\xfe\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
10 var_dump(bin2hex(mb_convert_encoding("\xff\xfe\xfe\xff\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
11 var_dump(bin2hex(mb_convert_encoding("\xfe\xff\xff\xfe\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
12 var_dump(bin2hex(mb_convert_encoding("\xfe\xff\xfe\xff\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
H A Dbug69086.phpt2 Request #69086 (enhancement for mb_convert_encoding)
8 var_dump("?" === mb_convert_encoding("\x80", "Shift_JIS", "EUC-JP"));
10 var_dump("\x00\x00\xff\xfd" === mb_convert_encoding("\x80", "UCS-4BE", "UTF-8"));
14 var_dump("\u{fffd}" === mb_convert_encoding("\x80", "UTF-8", "EUC-JP-2004"));
H A Dgh9535b.phpt24 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
26 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
35 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
37 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
46 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
48 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
57 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
59 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
68 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
70 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
H A Dmb_substr.phpt14 $euc_jp = mb_convert_encoding('0123この文字列は日本語です。EUC-JPを使っています。日本語は面倒臭い。', 'EUC-JP', 'UTF-8');
16 $sjis = mb_convert_encoding('日本語テキストです。0123456789。', 'SJIS', 'UTF-8');
20 $gb18030 = mb_convert_encoding('密码用户名密码名称名称', 'GB18030', 'UTF-8');
26 $utf32 = mb_convert_encoding($utf8, 'UTF-32', 'UTF-8');
28 $utf7 = mb_convert_encoding($utf8, 'UTF-7', 'UTF-8');
101 print "1: " . mb_convert_encoding(mb_substr($utf32, 0, 3, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
105 print "5:" . mb_convert_encoding(mb_substr($utf32, 10, 0, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
108 print "1: " . mb_convert_encoding(mb_substr($utf7, 0, 3, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
110 print "3: " . mb_convert_encoding(mb_substr($utf7, -5, 3, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
111 print "4: " . mb_convert_encoding(mb_substr($utf7, 1, null, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
[all …]
H A Dmb_substitute_character_variation2.phpt12 var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
15 var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
17 var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
19 var_dump(bin2hex(mb_convert_encoding($string_mb, "ISO-8859-1", "UTF-8")));
H A Dgh9535.phpt29 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
31 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
40 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
42 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
51 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
53 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
62 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
64 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
73 $converted_str = mb_convert_encoding($input, $encoding, mb_internal_encoding());
75 $reconverted_str = mb_convert_encoding($cut_str, mb_internal_encoding(), $encoding);
H A Dmb_substr_count.phpt33 var_dump(@mb_substr_count(mb_convert_encoding($a, $to_enc),
34 mb_convert_encoding($b, $to_enc), $to_enc));
37 var_dump(@mb_substr_count(mb_convert_encoding($a, $to_enc),
38 mb_convert_encoding($b, $to_enc), $to_enc));
H A Dmb_convert_encoding_failed_detection.phpt2 mb_convert_encoding() when encoding detection fails
10 var_dump(mb_convert_encoding("\xff", "ASCII", ["UTF-8", "UTF-16"]));
18 Warning: mb_convert_encoding(): Unable to detect character encoding in %s on line %d
H A Dmb_substitute_character.phpt12 var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
16 var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
20 var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
24 var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8")));
H A Dbug25140.phpt2 Bug #25140 (mb_convert_encoding returns FALSE on an empty string)
7 var_dump( mb_convert_encoding( '', 'SJIS', 'EUC-JP' ) );
H A Dbug60306.phpt8 var_dump($s === mb_convert_encoding(mb_convert_encoding($s, "cp936", "utf8"), "utf8", "cp936"));
H A Dmb_convert_encoding_leak.phpt2 mb_convert_encoding() shouldn't leak keys
10 mb_convert_encoding($array, 'UTF-8', 'UTF-8');
H A Dbug76958.phpt9 echo mb_convert_encoding($str, 'UTF-8', 'UTF7-IMAP') . "\n";
11 echo mb_convert_encoding($str, 'UTF7-IMAP', 'UTF-8') . "\n";
H A Dbug46843.phpt7 var_dump(bin2hex(mb_convert_encoding("\x80", 'UCS-2BE', 'CP936')));
8 var_dump(bin2hex(mb_convert_encoding("\x20\xac", 'CP936', 'UCS-2BE')));

Completed in 26 milliseconds

123