php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40626 preg_match and koi8-r
Submitted: 2007-02-25 07:24 UTC Modified: 2007-03-05 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: themixa at gmail dot com Assigned:
Status: No Feedback Package: PCRE related
PHP Version: 4.4.5 OS: Linux(PHP-5.1.6), Freebsd(PHP-4)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
38 + 22 = ?
Subscribe to this entry?

 
 [2007-02-25 07:24 UTC] themixa at gmail dot com
Description:
------------
preg_match don't recognize some letters in KOI8-R.

Reproduce code:
---------------
<?
$result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
 if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
        die("skip setlocale() failed\n");
}
#FRS is First russian letter
#LRS is Last russian letter
echo preg_match("/^[&#1072;-&#1103;&#1040;-&#1071;]+$/","&#1081;&#1094;&#1091;&#1082;&#1077;&#1085;&#1075;&#1096;&#1097;&#1079;&#1093;&#1098;&#1092;&#1099;&#1074;&#1072;&#1087;&#1088;&#1086;&#1083;&#1076;&#1078;&#1101;&#1103;&#1095;&#1089;&#1084;&#1080;&#1090;&#1100;&#1073;&#1102;");
#patterrn with [frs-lrsFRS-LRS] and string contained full russian alphabet return 0
echo preg_match("/^[&#1072;-&#1103;&#1040;-&#1071;]+$/","&#1072;&#1073;&#1043;&#1044;&#1077;&#1082;");
#patterrn with [frs-lrsFRS-LRS] and string some few russian letters (forexample, without third letter in alphabet) return 1

?>

Expected result:
----------------
First and second preg_match must return 1

Actual result:
--------------
Only second preg_match must return 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-05 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 28 12:01:27 2024 UTC