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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy