#46806 [Opn->Asn]: mb_strimwidth
| From: | kalle@php.net | Date: | Sat, 10 Jan 2009 16:52:41 +0000 |
| Subject: | #46806 [Opn->Asn]: mb_strimwidth | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-1712@lists.php.net to get a copy of this message | ||
ID: 46806
Updated by: kalle@php.net
Reported By: swiab0729 at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Documentation problem
Operating System: FreeBSD
PHP Version: 5.2CVS-2008-12-09 (CVS)
Assigned To: moriyoshi
Previous Comments:
------------------------------------------------------------------------
[2009-01-04 16:37:27] moriyoshi@php.net
The behavior is correct, but the document is wrong.
See http://news.php.net/php.internals/42473
------------------------------------------------------------------------
[2008-12-09 03:35:19] swiab0729 at gmail dot com
Description:
------------
When the original sring $str is longer then $width of the desired trim,
the width of the truncated string returned by mb_strimwidth() will count
"length of $trimmarker" in.
Reproduce code:
---------------
echo mb_strimwidth('helloworld', 0, 5, '...', 'UTF-8');
echo mb_strimwidth('hello', 0, 5, '...', 'UTF-8');
Expected result:
----------------
hello...
hello
Actual result:
--------------
he...
hello
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46806&edit=1