Lines Matching refs:n
19 echo "== ASCII ==\n";
20 print mb_strlen($ascii,'ASCII') . "\n";
21 print strlen($ascii) . "\n";
23 echo "== EUC-JP ==\n";
24 print mb_strlen($euc_jp,'EUC-JP') . "\n";
25 mb_internal_encoding('EUC-JP') or print("mb_internal_encoding() failed\n");
26 print strlen($euc_jp) . "\n";
28 echo "== SJIS ==\n";
30 print mb_strlen($sjis,'SJIS') . "\n";
31 mb_internal_encoding('SJIS') or print("mb_internal_encoding() failed\n");
32 print strlen($sjis) . "\n";
33 print "-- Testing illegal bytes 0x80,0xFD-FF --\n";
35 print mb_strlen("\x80\xA1", 'SJIS') . "\n";
36 print mb_strlen("abc\xFD\xFE\xFF", 'SJIS') . "\n";
38 echo "== CP932 ==\n";
39 print mb_strlen("\x80\xA1", "CP932") . "\n";
41 print mb_strlen("abc\xFD\xFE\xFF", 'CP932') . "\n";
42 print mb_strlen("\x80\xA1", "SJIS-win") . "\n";
43 print mb_strlen("abc\xFD\xFE\xFF", 'SJIS-win') . "\n";
45 echo "== MacJapanese ==\n";
46 print mb_strlen("\x80\xA1", 'MacJapanese') . "\n";
47 print mb_strlen("abc\xFD\xFE\xFF", 'MacJapanese') . "\n";
49 echo "== SJIS-2004 ==\n";
50 print mb_strlen("\x80\xA1", 'SJIS-2004') . "\n";
51 print mb_strlen("abc\xFD\xFE\xFF", 'SJIS-2004') . "\n";
53 echo "== SJIS-Mobile#DOCOMO ==\n";
54 print mb_strlen("\x80\xA1", 'SJIS-Mobile#DOCOMO') . "\n";
55 print mb_strlen("abc\xFD\xFE\xFF", 'SJIS-Mobile#DOCOMO') . "\n";
57 echo "== SJIS-Mobile#KDDI ==\n";
58 print mb_strlen("\x80\xA1", 'SJIS-Mobile#KDDI') . "\n";
59 print mb_strlen("abc\xFD\xFE\xFF", 'SJIS-Mobile#KDDI') . "\n";
61 echo "== SJIS-Mobile#SoftBank ==\n";
62 print mb_strlen("\x80\xA1", 'SJIS-Mobile#SoftBank') . "\n";
63 print mb_strlen("abc\xFD\xFE\xFF", 'SJIS-Mobile#SoftBank') . "\n";
65 echo "== JIS ==\n";
67 print mb_strlen($jis,'JIS') . "\n";
68 mb_internal_encoding('JIS') or print("mb_internal_encoding() failed\n");
69 print strlen($jis) . "\n";
71 echo "== UTF-8 ==\n";
73 print mb_strlen($utf8,'UTF-8') . " codepoints\n";
74 mb_internal_encoding('UTF-8') or print("mb_internal_encoding() failed\n");
75 print strlen($utf8) . " bytes\n";
79 print mb_strlen($utf8, 'UTF-8') . "\n";
80 print mb_strlen($long_utf8, 'UTF-8') . "\n";
82 echo "== UTF-8 with performance optimizations ==\n";
86 print mb_strlen($utf8, 'UTF-8') . "\n";
87 print mb_strlen($long_utf8, 'UTF-8') . "\n";
91 print mb_strlen($str, 'UTF-8') . "\n";
94 echo "== WRONG PARAMETERS ==\n";