Bug #67986 [Opn->Fbk]: preg函数处理utf8中文

From: Date: Tue, 09 Sep 2014 08:26:57 +0000
Subject: Bug #67986 [Opn->Fbk]: preg函数处理utf8中文
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-12266@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67986&edit=1 ID: 67986 Updated by: tony2001@php.net Reported by: pz9042 at 163 dot com Summary: preg函数处理utf8中文 -Status: Open +Status: Feedback Type: Bug Package: PECL Operating System: win PHP Version: 5.4.32 Block user comment: N Private report: N New Comment: Sorry, only half of the world speaks Chinese these days, the other half mostly uses English. Try reporting the same in English, pls. Previous Comments: ------------------------------------------------------------------------ [2014-09-09 06:38:21] pz9042 at 163 dot com Description: ------------ 在一用preg_match或者preg_match_all 或者preg_replace处理一段utf8编码的中文时,谷歌浏览器报与localhost的连接中断,火狐则跳转到www.localhost.com页面,经排查,讲字符转成ansi编码,就不会出现问题,且在win下cli下,也不会错误,只有用浏览器会出现此问题,web服务器是apache,不管是浏览器还是cli,php的配置文件是同一个 Test script: --------------- header("Content-type: text/html; charset=utf-8"); ini_set('pcre.backtrack_limit', '-1'); ini_set('pcre.recursion_limit', '-1'); $source = '<p>用户注册须具有法定的相应权利能力和行为能力的自然人、法人或其他组织,能够独立承担法律责任。您完成注册程序或其他十色网平台同意的方式实际使用本平台服务时,即视为您确认自己具备主体资格,能够独立承担法律责任。若因您不具备主体资格,而导致的一切后果,由您及您的监护人自行承担。</p>'; preg_match( "/([^a-zA-Z0-9_]{1,1})+(copy|fputs|fopen|file_put_contents|fwrite|eval|phpinfo)+/is" ,$source ,$match ); print_r($match);exit; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67986&edit=1

« previous php.pecl.dev (#12266) next »