#29760 [Bgs]: not correct works function, separators are placed accidentally
| From: | derick@php.net | Date: | Fri, 20 Aug 2004 08:11:37 +0000 |
| Subject: | #29760 [Bgs]: not correct works function, separators are placed accidentally | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64994@lists.php.net to get a copy of this message | ||
ID: 29760
Updated by: derick@php.net
Reported By: sych at php dot com dot ua
Status: Bogus
Bug Type: Strings related
Operating System: win2000
PHP Version: 5.0.0
New Comment:
wordwrap doesn't know about UTF and considers a multi-byte utf
characters as as many characters as there are bytes in there. However,
it will still break correctly on " " and "#" (or all other characters
in the ascii range (0-127).
However, this is not a bug as it was only meant to work on iso-8859-*.
Previous Comments:
------------------------------------------------------------------------
[2004-08-20 10:01:51] sych at php dot com dot ua
Yesterday I mistaken with examples there was heavy workday ,but
function wordwrap works not correct with UTF-8 encoding.
------------------------------------------------------------------------
[2004-08-19 16:42:17] derick@php.net
Ah, there was already a script.
The wordwrap function seperates on characters (second parameter), not
words.
Please read the documentation at http://php.net/wordwrap
------------------------------------------------------------------------
[2004-08-19 16:35:16] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2004-08-19 16:30:55] sych at php dot com dot ua
Code1:
$text = wordwrap($string, 2, "#");
Result1:
word1#word2#word3#word4#word5#word6#word7#word8"
Expected result1:
word1 word2# word3 word4# word5 word6# word7 word8
Code2:
$text = wordwrap($string, 3, "#");
Result2:
word1#word2#word3#word4#word5#word6#word7#word8"
Expected result2:
word1 word2 word3# word4 word5 word6# word7 word8
------------------------------------------------------------------------
[2004-08-19 16:22:56] tony2001@php.net
Err.. Forget it, clicked on a wrong link.
Please, provide more information, your example is not readable.
------------------------------------------------------------------------
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/29760
--
Edit this bug report at http://bugs.php.net/?id=29760&edit=1