php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65833 wordwrap unicode issues
Submitted: 2013-10-04 14:49 UTC Modified: 2013-10-23 02:06 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: euromark at web dot de Assigned:
Status: Open Package: mbstring related
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: euromark at web dot de
New email:
PHP Version: OS:

 

 [2013-10-04 14:49 UTC] euromark at web dot de
Description:
------------
wordwrap() is not able (by design) to properly work with unicode. 
Even with the latest PHP versions, though, there is no proper unicode support for wordwrap(), e.g. via MB functionality.

We ended up to "write" our own function to fix this bug, but it would be nice if a future version would provide this natively.
See the code linked below for concrete details.

Test script:
---------------
See the following PR code for

a) test cases to proof the defencency
b) a (PHP) fix to overcome it

https://github.com/cakephp/cakephp/pull/1695/files#diff-c3726f6e24d3c82640dc380aa9a0be17R352

Expected result:
----------------
I would expect to either have wordwrap() properly work with Unicode input (A pretty common scenario these days) or to have mb_wordwrap() available to handle this.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-23 02:06 UTC] yohgaki@php.net
-Type: Bug +Type: Feature/Change Request
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 17:01:26 2020 UTC