php-src/ext/mbstring/tests/014.inc

24 lines
804 B
PHP
Raw Normal View History

2002-03-02 10:44:57 +00:00
<?php
// TODO: Add more encoding
//$debug = true;
ini_set('include_path','.');
include_once('common.php');
2002-03-02 10:44:57 +00:00
// EUC-JP
$euc_jp = '0123<32><33><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܸ<EFBFBD><DCB8>Ǥ<EFBFBD><C7A4><EFBFBD>EUC-JP<4A><50><EFBFBD>ȤäƤ<C3A4><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܸ<EFBFBD><DCB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD><EFBFBD><EFBFBD>';
print "1: ". mb_strimwidth($euc_jp, 0, 15,'...','EUC-JP') . "\n";
print "2: ". mb_strimwidth($euc_jp, 0, 100,'...','EUC-JP') . "\n";
print "3: ". mb_strimwidth($euc_jp, 15, 100,'...','EUC-JP') . "\n";
// Note: Did not start form -22 offset. Staring from 0.
$str = mb_strimwidth($euc_jp,-22, 100,'...','EUC-JP');
($str === FALSE) ? print "4 OK\n" : print "NG: $str\n";
2002-03-02 10:44:57 +00:00
$str = mb_strimwidth($euc_jp, 100, -10,'...','EUC-JP');
($str === FALSE) ? print "5 OK\n" : print "NG: $str\n";
2002-03-02 10:44:57 +00:00
$str = mb_strimwidth($euc_jp, -100, 10,'...','EUC-JP');
($str === FALSE) ? print "6 OK\n" : print "NG: $str\n";
2002-03-02 10:44:57 +00:00
?>