tchwork / utf8

Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP
Apache License 2.0
627 stars 50 forks source link

Utf8::wordwrap and strings with new lines #18

Closed matlouis closed 10 years ago

matlouis commented 10 years ago

Utf8::wordwrap doesn't work correctly when the input string contains new lines:

$str = "string\nwith\nnew\nlines";
echo \Patchwork\Utf8::wordwrap($str);

should output the string unchanged (like php's wordwrap), but it outputs:

string
stringwith
stringwithnew
stringwithnewlines