From: svs at ropnet dot ru Operating system: FreeBSD 4.8 PHP version: 4.3.3 PHP Bug Type: Regexps related Bug description: eregi() vs. 8-bit chars in regex
Description: ------------ Even though locale is set up correctly, eregi() fails to match international characters case-insensitively. The reason, as far as I understand, is that code in regex/ passes a negative value to isalpha(). This can be worked around by recompiling regex/regcomp.c manually with -funsigned-char (assuming GCC is the compiler). Reproduce code: --------------- <?php setlocale(LC_ALL, "ru_RU.KOI8-R"); echo setlocale(LC_ALL, ""), "\n"; if (eregi("я", "ЯЯ")) { echo "ok\n"; } else { echo "bad\n";} if (preg_match("/я/i", "ЯЯ")) { echo "ok\n"; } else { echo "bad\n";} ?> Expected result: ---------------- ru_RU.KOI8-R ok ok Actual result: -------------- ru_RU.KOI8-R bad ok -- Edit bug report at http://bugs.php.net/?id=25669&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25669&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25669&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25669&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25669&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25669&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25669&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25669&r=support Expected behavior: http://bugs.php.net/fix.php?id=25669&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25669&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25669&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25669&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25669&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25669&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25669&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25669&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=25669&r=float