~ubuntu-branches/ubuntu/lucid/php5/lucid

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-03-16 09:09:50 UTC
  • mfrom: (1.1.18 upstream) (0.3.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100316090950-e36m0pzranoixifd
Tags: 5.3.2-1ubuntu1
* Merge from debian unstable: 
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions already in
      universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
  - Dropped debian/patches/libedit_is_editline.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug #49354 (mb_strcut() cuts wrong length when offset is in the middle of a multibyte character)
 
3
--SKIPIF--
 
4
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
 
5
--FILE--
 
6
<?php
 
7
$crap = 'AåBäCöDü';
 
8
var_dump(mb_strcut($crap, 0, 100, 'UTF-8'));
 
9
var_dump(mb_strcut($crap, 1, 100, 'UTF-8'));
 
10
var_dump(mb_strcut($crap, 2, 100, 'UTF-8'));
 
11
var_dump(mb_strcut($crap, 3, 100, 'UTF-8'));
 
12
var_dump(mb_strcut($crap, 12, 100, 'UTF-8'));
 
13
var_dump(mb_strcut($crap, 13, 100, 'UTF-8'));
 
14
?>
 
15
--EXPECT--
 
16
string(12) "AåBäCöDü"
 
17
string(11) "åBäCöDü"
 
18
string(11) "åBäCöDü"
 
19
string(9) "BäCöDü"
 
20
string(0) ""
 
21
bool(false)