Lines Matching refs:n
30 print "1: ". bin2hex(mb_substr($euc_jp, 10, 10,'EUC-JP')) . "\n";
31 print "2: ". bin2hex(mb_substr($euc_jp, 0, 100,'EUC-JP')) . "\n";
35 ($str === "") ? print "3 OK\n" : print "NG: ".bin2hex($str)."\n";
38 print ($str !== "") ? "4 OK: " . bin2hex($str) . "\n" : "BAD: " . bin2hex($str) . "\n";
40 echo "SJIS:\n";
41 print "1: " . bin2hex(mb_substr($sjis, 0, 3, 'SJIS')) . "\n";
42 print "2: " . bin2hex(mb_substr($sjis, -1, null, 'SJIS')) . "\n";
43 print "3: " . bin2hex(mb_substr($sjis, -5, 3, 'SJIS')) . "\n";
44 print "4: " . bin2hex(mb_substr($sjis, 1, null, 'SJIS')) . "\n";
45 print "5:" . bin2hex(mb_substr($sjis, 10, 0, 'SJIS')) . "\n";
46 echo "-- Testing illegal SJIS byte 0x80 --\n";
47 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS')) . "\n";
48 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS')) . "\n";
50 echo "SJIS-2004:\n";
51 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-2004')) . "\n";
52 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-2004')) . "\n";
54 echo "MacJapanese:\n";
55 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'MacJapanese')) . "\n";
56 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'MacJapanese')) . "\n";
58 echo "SJIS-Mobile#DOCOMO:\n";
59 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-Mobile#DOCOMO')) . "\n";
60 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-Mobile#DOCOMO')) . "\n";
62 echo "SJIS-Mobile#KDDI:\n";
63 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-Mobile#KDDI')) . "\n";
64 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-Mobile#KDDI')) . "\n";
66 echo "SJIS-Mobile#SoftBank:\n";
67 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-Mobile#SoftBank')) . "\n";
68 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-Mobile#SoftBank')) . "\n";
70 echo "ISO-2022-JP:\n";
71 print "1: " . bin2hex(mb_substr($iso2022jp, 0, 3, 'ISO-2022-JP')) . "\n";
72 print "2: " . bin2hex(mb_substr($iso2022jp, -1, null, 'ISO-2022-JP')) . "\n";
73 print "3: " . bin2hex(mb_substr($iso2022jp, -6, 3, 'ISO-2022-JP')) . "\n";
74 print "4: " . bin2hex(mb_substr($iso2022jp, -3, 2, 'ISO-2022-JP')) . "\n";
75 print "5: " . bin2hex(mb_substr($iso2022jp, 1, null, 'ISO-2022-JP')) . "\n";
76 print "6:" . bin2hex(mb_substr($iso2022jp, 10, 0, 'ISO-2022-JP')) . "\n";
77 print "7:" . bin2hex(mb_substr($iso2022jp, 100, 10, 'ISO-2022-JP')) . "\n";
79 echo "GB-18030:\n";
80 print "1: " . bin2hex(mb_substr($gb18030, 0, 3, 'GB-18030')) . "\n";
81 print "2: " . bin2hex(mb_substr($gb18030, -1, null, 'GB-18030')) . "\n";
82 print "3: " . bin2hex(mb_substr($gb18030, -5, 3, 'GB-18030')) . "\n";
83 print "4: " . bin2hex(mb_substr($gb18030, 1, null, 'GB-18030')) . "\n";
84 print "5:" . bin2hex(mb_substr($gb18030, 10, 0, 'GB-18030')) . "\n";
86 echo "HZ:\n";
87 print "1: " . mb_substr($hz, 0, 3, 'HZ') . "\n";
88 print "2: " . mb_substr($hz, -1, null, 'HZ') . "\n";
89 print "3: " . mb_substr($hz, -5, 3, 'HZ') . "\n";
90 print "4: " . mb_substr($hz, 1, null, 'HZ') . "\n";
91 print "5:" . mb_substr($hz, 10, 0, 'HZ') . "\n";
93 echo "UTF-8:\n";
94 print "1: " . mb_substr($utf8, 0, 3, 'UTF-8') . "\n";
95 print "2: " . mb_substr($utf8, -1, null, 'UTF-8') . "\n";
96 print "3: " . mb_substr($utf8, -5, 3, 'UTF-8') . "\n";
97 print "4: " . mb_substr($utf8, 1, null, 'UTF-8') . "\n";
98 print "5:" . mb_substr($utf8, 10, 0, 'UTF-8') . "\n";
100 echo "UTF-32:\n";
101 print "1: " . mb_convert_encoding(mb_substr($utf32, 0, 3, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
102 print "2: " . mb_convert_encoding(mb_substr($utf32, -1, null, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
103 print "3: " . mb_convert_encoding(mb_substr($utf32, -5, 3, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
104 print "4: " . mb_convert_encoding(mb_substr($utf32, 1, null, '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";
107 echo "UTF-7:\n";
108 print "1: " . mb_convert_encoding(mb_substr($utf7, 0, 3, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
109 print "2: " . mb_convert_encoding(mb_substr($utf7, -1, null, '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";
112 print "5:" . mb_convert_encoding(mb_substr($utf7, 10, 0, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";