diff --git a/src/applications/maniphest/view/ManiphestTransactionDetailView.php b/src/applications/maniphest/view/ManiphestTransactionDetailView.php index ea8e97b8f8..c7e509a1f8 100644 --- a/src/applications/maniphest/view/ManiphestTransactionDetailView.php +++ b/src/applications/maniphest/view/ManiphestTransactionDetailView.php @@ -570,8 +570,8 @@ final class ManiphestTransactionDetailView extends ManiphestView { case ManiphestTransactionType::TYPE_DESCRIPTION: $id = $transaction->getID(); - $old_text = wordwrap($transaction->getOldValue(), 80); - $new_text = wordwrap($transaction->getNewValue(), 80); + $old_text = phutil_utf8_hard_wrap($transaction->getOldValue(), 80); + $new_text = phutil_utf8_hard_wrap($transaction->getNewValue(), 80); $engine = new PhabricatorDifferenceEngine(); $changeset = $engine->generateChangesetFromFileContent($old_text, diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index 18c7faf785..b93f6c449e 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -48,8 +48,8 @@ final class PhrictionDiffController $text_l = $content_l->getContent(); $text_r = $content_r->getContent(); - $text_l = wordwrap($text_l, 80); - $text_r = wordwrap($text_r, 80); + $text_l = phutil_utf8_hard_wrap($text_l, 80); + $text_r = phutil_utf8_hard_wrap($text_r, 80); $engine = new PhabricatorDifferenceEngine(); diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php index 3ae2491335..9f65a887e9 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php @@ -23,10 +23,8 @@ final class PhabricatorApplicationTransactionTextDiffDetailView // TODO: On mobile, or perhaps by default, we should switch to 1-up once // that is built. - // TODO: This should be utf8-aware, but we don't currently have a plain-text - // utf8 hard-wrap function. See T2554. - $old = wordwrap($old, 80); - $new = wordwrap($new, 80); + $old = phutil_utf8_hard_wrap($old, 80); + $new = phutil_utf8_hard_wrap($new, 80); $engine = new PhabricatorDifferenceEngine(); $changeset = $engine->generateChangesetFromFileContent($old, $new);