From:             
Operating system: Centos 5.5 x64
PHP version:      5.2.14
Package:          mbstring related
Bug Type:         Bug
Bug description:mb_ereg_replace and the Greek capital Pi

Description:
------------
PHP: 5.2.14, Apache 2.2.15, mod_php



While \s is supposed to match all whitespace, the greek unicode letter Pi
(Π) whose code is 0xCEA0 is matched too and if replaced with something,
it's stripped of its second byte (0xA0).

Test script:
---------------
<?php

mb_internal_encoding('UTF-8');



$testStr = 'Π  Π  Π!';

$newStr = mb_ereg_replace('\s+','_',$testStr);

echo $testStr;

echo $newStr;

echo urlencode($testStr);

echo urlencode($newStr);

?>

Expected result:
----------------
Π  Π  Π!

Π__Π__Π!

%CE%A0++%CE%A0++%CE%A0%21

%CE%A0__%CE%A0__%CE%A0%21

Actual result:
--------------
Π  Π  Π!

[non printable character]_[non printable character]_[non printable
character]!

%CE%A0++%CE%A0++%CE%A0%21

%CE_%CE_%CE_%21

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52592&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52592&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52592&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52592&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52592&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52592&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52592&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52592&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52592&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52592&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52592&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52592&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52592&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52592&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52592&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52592&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52592&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52592&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52592&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52592&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52592&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52592&r=mysqlcfg

Reply via email to