Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column width of emoji appears incorrect #12

Open
FGasper opened this issue Feb 25, 2022 · 2 comments
Open

Column width of emoji appears incorrect #12

FGasper opened this issue Feb 25, 2022 · 2 comments

Comments

@FGasper
Copy link

FGasper commented Feb 25, 2022

use strict;
use warnings;

my @rows;

use v5.10;
use Term::Table;

use utf8;
push @rows, [ 'Contraseña', 'non-repair only' ];
push @rows, [ '密码',        'non-repair only' ];
push @rows, [ '🏄',          'surfing' ];

        for (
            Term::Table->new(
                header => [ 'Task', 'Type' ],
                rows   => \@rows,
            )->render
        ) {
            utf8::encode($_);
            say;
        }

… outputs:

+------------+-----------------+
| Task       | Type            |
+------------+-----------------+
| Contraseña | non-repair only |
| 密码       | non-repair only |
| 🏄          | surfing         |
+------------+-----------------+

The last row’s first column looks like it should have one fewer space?

@FGasper
Copy link
Author

FGasper commented Feb 25, 2022

Interestingly, my GH/browser …
image
… draws this differently from my terminal (iTerm2) …
image
So maybe this is a Unicode-being-Unicode thing?

@FGasper
Copy link
Author

FGasper commented Feb 25, 2022

NB: The system in question has Unicode::GCString installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant