Skip to content

Commit a567e05

Browse files
committed
issues/60038: Table counts wrong number of padding symbols in method renderCell(..) when cell contain unicode variant selector.
1 parent 2e85f07 commit a567e05

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
@@ -548,7 +548,7 @@ private function renderCell(array $row, int $column, string $cellFormat): string
548548

549549
// str_pad won't work properly with multi-byte strings, we need to fix the padding
550550
if (false !== $encoding = mb_detect_encoding($cell, null, true)) {
551-
$width += \strlen($cell) - mb_strwidth($cell, $encoding);
551+
$width += \strlen($cell) - mb_strwidth(str_replace(["\xef\xb8\x8f", "\xef\xb8\x8e", ], "", $cell), $encoding);
552552
}
553553

554554
$style = $this->getColumnStyle($column);

0 commit comments

Comments
 (0)