~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/mbstring/tests/mb_strcut.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
Import upstream version 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
mb_strcut()
 
3
--SKIPIF--
 
4
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
 
5
--INI--
 
6
output_handler=
 
7
--FILE--
 
8
<?php
 
9
// TODO: Add more encodings
 
10
ini_set('include_path','.');
 
11
include_once('common.inc');
 
12
 
 
13
// EUC-JP
 
14
$euc_jp = '0123����ʸ��������ܸ�Ǥ���EUC-JP��ȤäƤ��ޤ������ܸ�����ݽ�����';
 
15
 
 
16
print  mb_strcut($euc_jp,  6,   5,'EUC-JP') . "\n";
 
17
print  mb_strcut($euc_jp,  0, 100,'EUC-JP') . "\n";
 
18
 
 
19
$str = mb_strcut($euc_jp, 100, 10,'EUC-JP');
 
20
($str === "") ? print "OK\n" : print "NG: $str\n";
 
21
 
 
22
$str = mb_strcut($euc_jp, -100, 10,'EUC-JP');
 
23
($str !== "") ? print "OK: $str\n" : print "NG:\n";
 
24
 
 
25
 
 
26
?>
 
27
 
 
28
--EXPECT--
 
29
��ʸ
 
30
0123����ʸ��������ܸ�Ǥ���EUC-JP��ȤäƤ��ޤ������ܸ�����ݽ�����
 
31
OK
 
32
OK: 0123����ʸ
 
33
 
 
34