Skip to content

[Console] Wrong width of cells containing multi-byte strings in TableHelper #8284

@damner

Description

@damner

To reproduce, create a table like this:

<?php
$table = $this->getHelperSet()->get('table');
$table->setHeaders(array('Ф'));
$table->setRows(array(array('11111')));
$table->render($output);

result:

+-------+
| Ф    |
+-------+
| 11111 |
+-------+

The problem is in using str_pad() function in method renderCell().
The function does not work correctly with multi-byte strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions