From c6c5a354a9945a5e9a9a6a495ca19558eb8639e9 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Wed, 14 May 2014 14:23:19 +0100 Subject: [PATCH] Explicitly define the encoding. --- Application.php | 2 +- .../application_renderexception_doublewidth2.txt | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Application.php b/Application.php index 32650e5a9..88162a210 100644 --- a/Application.php +++ b/Application.php @@ -1151,7 +1151,7 @@ private function splitStringByWidth($string, $width) $line = ''; foreach (preg_split('//u', $utf8String) as $char) { // test if $char could be appended to current line - if (mb_strwidth($line.$char) <= $width) { + if (mb_strwidth($line.$char, 'utf8') <= $width) { $line .= $char; continue; } diff --git a/Tests/Fixtures/application_renderexception_doublewidth2.txt b/Tests/Fixtures/application_renderexception_doublewidth2.txt index 5605f1069..545cd7b0b 100644 --- a/Tests/Fixtures/application_renderexception_doublewidth2.txt +++ b/Tests/Fixtures/application_renderexception_doublewidth2.txt @@ -1,11 +1,10 @@ - - [Exception] - コマンドの実行中に - エラーが発生しまし - た。 - + + [Exception] + コマンドの実行中にエラーが + 発生しました。 + foo