Bug #77093 [NEW]: mb_ereg_replace() does not work with SJIS-win(cp932)

From: Date: Fri, 02 Nov 2018 01:32:48 +0000
Subject: Bug #77093 [NEW]: mb_ereg_replace() does not work with SJIS-win(cp932)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217789@lists.php.net to get a copy of this message
From: ryosuke dot kobayashi at fujisystems dot co dot jp Operating system: Linux PHP version: 7.2.11 Package: mbstring related Bug Type: Bug Bug description:mb_ereg_replace() does not work with SJIS-win(cp932) Description: ------------ mb_ereg_replace() just returns null when given string contains some specific characters in 'SJIS-win' (e.g. 'ⅰ', '伃'...), and it works without output errors. Between 0xFA40('ⅰ') and 0xFC4B('黑') causes this bug, imo. It also happens with mb_ereg_match*(). I confirmed that this happens PHP Version 7.1 or higher. Here's a results I tried. PHP 7.0.32 with oniguruma 5.9.6 => It works. PHP 7.0.32 with oniguruma 6.3.0 => It works. PHP 7.1.23 with oniguruma 5.9.6 => It does not work. PHP 7.2.11 with oniguruma 6.3.0 => It does not work. Test script: --------------- function chk($a,$b){ mb_internal_encoding('SJIS-win'); $j=0; for($i=$a;$i<$b;$i++){ $s=sprintf('%x',$i); $hex = hex2bin($s); if(mb_check_encoding($hex)){ if (!mb_ereg($hex, $hex)){ echo "$s($hex):NG\n"; } }else{ } $j++; } echo "cnt:$j\n"; } chk(0xED40,0xFC51); -- Edit bug report at https://bugs.php.net/bug.php?id=77093&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77093&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77093&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77093&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77093&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77093&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77093&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77093&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77093&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77093&r=support Expected behavior: https://bugs.php.net/fix.php?id=77093&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77093&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77093&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77093&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77093&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77093&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77093&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77093&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77093&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77093&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77093&r=mysqlcfg

« previous php.bugs (#217789) next »