From 619ff5818f9540362ec2aa35dec0cc39263b6278 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. --- src/Symfony/Component/Console/Application.php | 2 +- .../application_renderexception_doublewidth2.txt | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 32650e5a9e..88162a210e 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -1151,7 +1151,7 @@ class Application $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/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt index 5605f10697..545cd7b0b4 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt @@ -1,11 +1,10 @@ - - [Exception] - コマンドの実行中に - エラーが発生しまし - た。 - + + [Exception] + コマンドの実行中にエラーが + 発生しました。 + foo