Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e812e6

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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/Symfony/Component/Console/Helper

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ private function renderCell(array $row, int $column, string $cellFormat): string
562562

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

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

0 commit comments

Comments
 (0)