Skip to content

Commit 6207389

Browse files
committed
bug symfony#10899 Explicitly define the encoding. (jakzal)
This PR was merged into the 2.3 branch. Discussion ---------- Explicitly define the encoding. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Credits for discovering it go to @nicolas-grekas. Cheers! Travis for PHP 5.6 cannot be enabled yet as there's one more test failing. re symfony#10714 symfony#10714 Commits ------- 619ff58 Explicitly define the encoding.
2 parents 7b93db5 + 619ff58 commit 6207389

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ private function splitStringByWidth($string, $width)
11511151
$line = '';
11521152
foreach (preg_split('//u', $utf8String) as $char) {
11531153
// test if $char could be appended to current line
1154-
if (mb_strwidth($line.$char) <= $width) {
1154+
if (mb_strwidth($line.$char, 'utf8') <= $width) {
11551155
$line .= $char;
11561156
continue;
11571157
}

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11

22

3-
4-
[Exception]
5-
コマンドの実行中に
6-
エラーが発生しまし
7-
た。
8-
3+
4+
[Exception]
5+
コマンドの実行中にエラーが
6+
発生しました。
7+
98

109

1110
foo

0 commit comments

Comments
 (0)