Skip to content

Commit c6c5a35

Browse files
committed
Explicitly define the encoding.
1 parent 6db33a2 commit c6c5a35

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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
}

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)