8000 Update Table.php · symfony/symfony@b7ed1c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit b7ed1c1

Browse files
authored
Update Table.php
Use mb_str_split instead of str_split because it's work wrong with multibyte chars when there is automatic width adjustment.
1 parent 2f62c4a commit b7ed1c1

File tree

1 file changed

+1
-1
lines changed
  • src/Symfony/Component/Console/Helper

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ private function calculateColumnsWidth(iterable $groups)
805805
$textContent = Helper::removeDecoration($this->output->getFormatter(), $cell);
806806
$textLength = Helper::width($textContent);
807807
if ($textLength > 0) {
808-
$contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan()));
808+
$contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan()));
809809
foreach ($contentColumns as $position => $content) {
810810
$row[$i + $position] = $content;
811811
}

0 commit comments

Comments
 (0)
0