Bug #75269 [NEW]: mb_​regex_​encoding() does not support GB18030 or CP1251

From: Date: Wed, 27 Sep 2017 21:21:53 +0000
Subject: Bug #75269 [NEW]: mb_​regex_​encoding() does not support GB18030 or CP1251
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211401@lists.php.net to get a copy of this message
From: gerthaubrich at web dot de Operating system: Debain 8 x64 PHP version: Irrelevant Package: mbstring related Bug Type: Bug Bug description:mb_​regex_​encoding() does not support GB18030 or CP1251 Description: ------------ Is there a reason why mb_​regex_​encoding() (and Oniguruma library) does not support CP1251 and GB18030 in PHP? (Because general mbstring functions do support these encodings.) I have checked PHP 5.4.45 (Oniguruma 4.7.1) up to PHP 7.0.23 and 7.1.9 (5.9.6) and now also 7.2.0 RC2 (6.3.0) and the function always accepts the same list of encodings over all these different library versions. According to Oniguruma history, support for GB18030 has been implemented in v3.8.4 and support for CP1251 (alias Windows-1251) has been implemented in v5.2.0 of the library. So I am wondering if this is a feature request or a bug in PHP? How does the function check for a valid/supported encoding name in PHP? Is the request passed through to the library itself, or is there some kind of whitelist implemented in PHP before the function call (that hasn't been updated for quiet some time)? Bug #23470 (05/2003 !) mentions option --enable-mbstring=all for CP1251, but this "all" value has never been mentioned in the latest configure scripts, I remember (e.g. the last 3 years or so). Does it still exist? For example the 7.2.0 RC2 source contains in \ext\mbstring\oniguruma\src also the files cp1251.c and gb18030.c, which are also referenced in config.w32 and in config.m4 and oniguruma.h defines ONIG_ENCODING_CP1251 and ONIG_ENCODING_GB18030. One additional thought for PHP 7.2: Maybe the team should consider to bump the Oniguruma version to at least version 6.4.0, instead of 6.3.0. The history mentions fixed memory leaks and a "endless repeat" error for 6.4.0 and only a few new features. BR -- Edit bug report at https://bugs.php.net/bug.php?id=75269&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75269&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75269&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75269&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75269&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75269&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75269&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75269&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75269&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75269&r=support Expected behavior: https://bugs.php.net/fix.php?id=75269&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75269&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75269&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75269&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75269&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75269&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75269&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75269&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75269&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75269&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75269&r=mysqlcfg

« previous php.bugs (#211401) next »