|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-08-28 13:17 UTC] manfred at mabuweb dot com
Description: ------------ mb_ereg_replace() and mb_eregi_replace() misinterpretate MBchars as word end. Reproduce code: --------------- $pattern = '\bas\b'; $string = 'D?as'; echo $string.'<br/>'; echo mb_ereg_replace($pattern, '', $string); Expected result: ---------------- D?as D?as Actual result: -------------- D?as D? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Good question! php -i |grep mbstring mbstring.detect_order => no value => no value mbstring.encoding_translation => Off => Off mbstring.func_overload => 0 => 0 mbstring.http_input => pass => pass mbstring.http_output => pass => pass mbstring.internal_encoding => ISO-8859-1 => no value mbstring.language => neutral => neutral mbstring.substitute_character => no value => no value If I change to UTF-8 everything seems to work as expected: ini_set('mbstring.internal_encoding', 'UTF-8');