8000 issues/60038: Table counts wrong number of padding symbols in method … · symfony/symfony@3bfaca0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3bfaca0

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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ private function renderCell(array $row, int $column, string $cellFormat): string
565565

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

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

0 commit comments

Comments
 (0)
0