#19690 [Ana->Csd]: mb_split is broken
| From: | moriyoshi@php.net | Date: | Mon, 07 Oct 2002 18:42:17 +0000 |
| Subject: | #19690 [Ana->Csd]: mb_split is broken | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-21736@lists.php.net to get a copy of this message | ||
ID: 19690
Updated by: moriyoshi@php.net
Reported By: jc@mega-bucks.co.jp
-Status: Analyzed
+Status: Closed
Bug Type: mbstring related
Operating System: Red Hat Linux 7.2
PHP Version: 4.2.3
New Comment:
After some discussion, extended mode is no more the default for
mb_split() and mb_ereg_xxxx(). Instead you can change the default
behaivour by this newly introduced function:
proto mb_regex_set_options(string options)
(Although this is not documented yet... I hope I will soon update
them.)
Anyway, thank you for the report.
Previous Comments:
------------------------------------------------------------------------
[2002-10-03 07:26:58] jc@mega-bucks.co.jp
I agree. Can this be added to the documentation then?
------------------------------------------------------------------------
[2002-10-02 06:44:14] moriyoshi@php.net
oops i forgot to change the status.
------------------------------------------------------------------------
[2002-10-02 06:42:38] moriyoshi@php.net
As of current implementation, mb_split() and mb_ereg() take the regex
pattern as extended mode one, in which white spaces, carridge returns,
and line feeds are ignored and any sequences beginning with "#" and
delimitted by "\n" are treated as comments.
So if you would like to use these characters in the pattern, you should
escape them with a backslash '\'.
IMO this implied behaviour is quite confusing, as we are more familiar
with split() and preg_split().
------------------------------------------------------------------------
[2002-10-01 13:09:33] moriyoshi@php.net
confirmed with HEAD.
------------------------------------------------------------------------
[2002-10-01 08:52:38] jc@mega-bucks.co.jp
Here are my PHP settings in case you need to see them
Multibyte (Japanese) Support enabled
multibyte regex support enabled
Directive Local Value Master Value
mbstring.detect_order auto auto
mbstring.func_overload 0 0
mbstring.http_input auto auto
mbstring.http_output no value no value
mbstring.internal_encoding EUC-JP EUC-JP
mbstring.substitute_character no value no value
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/19690
--
Edit this bug report at http://bugs.php.net/?id=19690&edit=1