Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Commit

Permalink
fix Shim\Mbstring
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Aug 19, 2013
1 parent d134633 commit 153c3b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion class/Patchwork/PHP/Shim/Mbstring.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static function mb_convert_case($s, $mode, $encoding = INF)
}
else
{
$s = substr_replace($s, $uchr, $i, $ulen);
$s = substr_replace($s, $uchr, $i - $ulen, $ulen);
$len += $nlen - $ulen;
$i += $nlen - $ulen;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Patchwork/Tests/PHP/Shim/MbstringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ function testmb_convert_enconding()
*/
function testStrCase()
{
$this->assertSame( 'déjà σσς', p::mb_strtolower('DÉJÀ Σσς') );
$this->assertSame( 'DÉJÀ ΣΣΣ', p::mb_strtoupper('Déjà Σσς') );
$this->assertSame( 'Déjà Σσσ', p::mb_convert_case('DÉJÀ ΣΣΣ', MB_CASE_TITLE) );
$this->assertSame( 'déjà σσς iiıi', p::mb_strtolower('DÉJÀ Σσς İIıi') );
$this->assertSame( 'DÉJÀ ΣΣΣ İIII', p::mb_strtoupper('Déjà Σσς İIıi') );
$this->assertSame( 'Déjà Σσσ Iı Ii', p::mb_convert_case('DÉJÀ ΣΣΣ ıı iI', MB_CASE_TITLE) );
}

/**
Expand Down

0 comments on commit 153c3b3

Please sign in to comment.