php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48327 preg_replace() if pattern was Chinese chart (gb2312),some thing was wrong!
Submitted: 2009-05-19 09:37 UTC Modified: 2009-05-21 12:11 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:0 of 0 (0.0%)
From: wiki345 at gmail dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.9 OS: Cenos 5.3 X86_64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wiki345 at gmail dot com
New email:
PHP Version: OS:

 

 [2009-05-19 09:37 UTC] wiki345 at gmail dot com
Description:
------------
preg_replace,preg_match function.
if pattern was Chinese characters(gb2312),Are not case-sensitive.

I test on Cenos 5.3 i686 is OK.
but on Cenos 5.3 x86_64 is wrong.

ͬ???????ã???x86_64Ϊϵͳ?Ͼͻ???????????????

????Centos x86_64 shell?ϲ??? pcregrep û?????⡣
????ͨ?? php ִ?оͻ?????. ????pattern???ִ?Сд?????????⣬?????ִ?Сд?ͻ??????⡣

Reproduce code:
---------------
<?
echo preg_replace("/??/i", "*", "word1:??, word2:??");
?>

Expected result:
----------------
word1:*, word2:??

Actual result:
--------------
word1:*, word2:*

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-19 09:57 UTC] wiki345 at gmail dot com
you can test preg_match() here:
http://bbs.voc.com.cn/v/preg_test.php
 [2009-05-19 10:55 UTC] jani@php.net
Are you building PHP with the bundled PCRE lib or with external one?

 [2009-05-19 11:43 UTC] wiki345 at gmail dot com
Both I have tried, but still the same result.

then i install the xampp on the x86_64 system, the same result too.
 [2009-05-21 12:11 UTC] jani@php.net
PCRE can do utf-8 but not gb2312. http://www.pcre.org/pcre.txt
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 11:01:31 2025 UTC