Lines Matching refs:n

27 echo "EUC-JP:\n";
28 print "1: ". bin2hex(mb_substr($euc_jp, 10, 10, 'EUC-JP')) . "\n";
29 print "2: ". bin2hex(mb_substr($euc_jp, 0, 100, 'EUC-JP')) . "\n";
32 print ($str === "") ? "3 OK\n" : "BAD: " . bin2hex($str) . "\n";
35 print ($str !== "") ? "4 OK: " . bin2hex($str) . "\n" : "BAD: " . bin2hex($str) . "\n";
37 echo "SJIS:\n";
38 print "1: " . bin2hex(mb_substr($sjis, 0, 3, 'SJIS')) . "\n";
39 print "2: " . bin2hex(mb_substr($sjis, -1, null, 'SJIS')) . "\n";
40 print "3: " . bin2hex(mb_substr($sjis, -5, 3, 'SJIS')) . "\n";
41 print "4: " . bin2hex(mb_substr($sjis, 1, null, 'SJIS')) . "\n";
42 print "5:" . bin2hex(mb_substr($sjis, 10, 0, 'SJIS')) . "\n";
43 echo "-- Testing illegal SJIS byte 0x80 --\n";
44 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS')) . "\n";
45 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS')) . "\n";
47 echo "SJIS-2004:\n";
48 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-2004')) . "\n";
49 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-2004')) . "\n";
51 echo "MacJapanese:\n";
52 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'MacJapanese')) . "\n";
53 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'MacJapanese')) . "\n";
55 echo "SJIS-Mobile#DOCOMO:\n";
56 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-Mobile#DOCOMO')) . "\n";
57 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-Mobile#DOCOMO')) . "\n";
59 echo "SJIS-Mobile#KDDI:\n";
60 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-Mobile#KDDI')) . "\n";
61 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-Mobile#KDDI')) . "\n";
63 echo "SJIS-Mobile#SoftBank:\n";
64 print bin2hex(mb_substr("\x80abc\x80\xA1", 3, 2, 'SJIS-Mobile#SoftBank')) . "\n";
65 print bin2hex(mb_substr("\x80abc\x80\xA1", 0, 3, 'SJIS-Mobile#SoftBank')) . "\n";
67 echo "ISO-2022-JP:\n";
68 print "1: " . bin2hex(mb_substr($iso2022jp, 0, 3, 'ISO-2022-JP')) . "\n";
69 print "2: " . bin2hex(mb_substr($iso2022jp, -1, null, 'ISO-2022-JP')) . "\n";
70 print "3: " . bin2hex(mb_substr($iso2022jp, -6, 3, 'ISO-2022-JP')) . "\n";
71 print "4: " . bin2hex(mb_substr($iso2022jp, -3, 2, 'ISO-2022-JP')) . "\n";
72 print "5: " . bin2hex(mb_substr($iso2022jp, 1, null, 'ISO-2022-JP')) . "\n";
73 print "6:" . bin2hex(mb_substr($iso2022jp, 10, 0, 'ISO-2022-JP')) . "\n";
74 print "7:" . bin2hex(mb_substr($iso2022jp, 100, 10, 'ISO-2022-JP')) . "\n";
76 echo "GB-18030:\n";
77 print "1: " . bin2hex(mb_substr($gb18030, 0, 3, 'GB-18030')) . "\n";
78 print "2: " . bin2hex(mb_substr($gb18030, -1, null, 'GB-18030')) . "\n";
79 print "3: " . bin2hex(mb_substr($gb18030, -5, 3, 'GB-18030')) . "\n";
80 print "4: " . bin2hex(mb_substr($gb18030, 1, null, 'GB-18030')) . "\n";
81 print "5:" . bin2hex(mb_substr($gb18030, 10, 0, 'GB-18030')) . "\n";
83 echo "HZ:\n";
84 print "1: " . mb_substr($hz, 0, 3, 'HZ') . "\n";
85 print "2: " . mb_substr($hz, -1, null, 'HZ') . "\n";
86 print "3: " . mb_substr($hz, -5, 3, 'HZ') . "\n";
87 print "4: " . mb_substr($hz, 1, null, 'HZ') . "\n";
88 print "5:" . mb_substr($hz, 10, 0, 'HZ') . "\n";
90 echo "UTF-8:\n";
91 print "1: " . mb_substr($utf8, 0, 3, 'UTF-8') . "\n";
92 print "2: " . mb_substr($utf8, -1, null, 'UTF-8') . "\n";
93 print "3: " . mb_substr($utf8, -5, 3, 'UTF-8') . "\n";
94 print "4: " . mb_substr($utf8, 1, null, 'UTF-8') . "\n";
95 print "5:" . mb_substr($utf8, 10, 0, 'UTF-8') . "\n";
97 echo "UTF-32:\n";
98 print "1: " . mb_convert_encoding(mb_substr($utf32, 0, 3, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
99 print "2: " . mb_convert_encoding(mb_substr($utf32, -1, null, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
100 print "3: " . mb_convert_encoding(mb_substr($utf32, -5, 3, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
101 print "4: " . mb_convert_encoding(mb_substr($utf32, 1, null, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
102 print "5:" . mb_convert_encoding(mb_substr($utf32, 10, 0, 'UTF-32'), 'UTF-8', 'UTF-32') . "\n";
104 echo "UTF-7:\n";
105 print "1: " . mb_convert_encoding(mb_substr($utf7, 0, 3, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
106 print "2: " . mb_convert_encoding(mb_substr($utf7, -1, null, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
107 print "3: " . mb_convert_encoding(mb_substr($utf7, -5, 3, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
108 print "4: " . mb_convert_encoding(mb_substr($utf7, 1, null, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";
109 print "5:" . mb_convert_encoding(mb_substr($utf7, 10, 0, 'UTF-7'), 'UTF-8', 'UTF-7') . "\n";