#46806 [Opn]: mb_strimwidth

From: Date: Sun, 04 Jan 2009 16:37:27 +0000
Subject: #46806 [Opn]: mb_strimwidth
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1692@lists.php.net to get a copy of this message
ID: 46806 Updated by: moriyoshi@php.net Reported By: swiab0729 at gmail dot com Status: Open -Bug Type: mbstring related +Bug Type: Documentation problem Operating System: FreeBSD PHP Version: 5.2CVS-2008-12-09 (CVS) -Assigned To: +Assigned To: moriyoshi New Comment: The behavior is correct, but the document is wrong. See http://news.php.net/php.internals/42473 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#1692) next »