|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2020-07-04 14:22 UTC] x dot xiang at outlook dot com
[2020-07-08 09:23 UTC] nikic@php.net
[2020-07-08 09:23 UTC] nikic@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 12 22:00:01 2025 UTC |
Description: ------------ When the string end with full-width character and its width is one greater than the desired trimming width,trimmaker is alse a half-width character, which will cause mb_strimwidth not to trim. Affects all stable versions of PHP. Test script: --------------- <?php echo mb_strimwidth("一二三", 0, 4, '.', 'UTF-8')."\n"; echo mb_strimwidth("一二三", 0, 5, '.', 'UTF-8')."\n"; echo mb_strimwidth("一二三", 0, 6, '.', 'UTF-8')."\n"; echo mb_strimwidth("abcdef", 0, 4, '.', 'UTF-8')."\n"; echo mb_strimwidth("abcdef", 0, 5, '.', 'UTF-8')."\n"; echo mb_strimwidth("abcdef", 0, 6, '.', 'UTF-8')."\n"; Expected result: ---------------- 一. 一二. 一二三 abc. abcd. abcdef Actual result: -------------- 一. 一二三 一二三 abc. abcd. abcdef