Skip Menu |
 

This queue is for tickets about the Unicode-LineBreak CPAN distribution.

Report information
The Basics
Id: 125896
Status: open
Priority: 0/
Queue: Unicode-LineBreak

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Math based on columns() seems correct but actual columns in use (using a monospace font) can be wrong
Download (untitled) / with headers
text/plain 662b
If you run the attached script in a terminal that does utf8 correctly and has a good Monospaced Unicode font like Menlo you'll note that the 🤔line is too far right. It is as if it actually takes up 2 columns but it is reported as 1 column. May not matter but it is a 5 digit code point and the others are 4. Thanks! ``` | I am ascii.......... | | ‼ what!............. | | ⁇ curious........... | | ✏️ take note......... | | 🤔 hmmm.............. | $VAR1 = { "\x{1f914} hmmm" => 6, "\x{203c} what!" => 7, 'I am ascii' => 10, "\x{2047} curious" => 9, "\x{270f}\x{fe0f} take note" => 11 }; ```
Subject: unicode_col.pl
Download unicode_col.pl
text/x-perl 448b
use strict; use warnings; use Data::Dumper; use Unicode::GCString; binmode STDOUT, ":utf8"; my %strings; my @strings = ( "I am ascii", "‼ what!", "⁇ curious", "✏️ take note", "🤔 hmmm" ); for my $str (@strings) { utf8::decode($str); my $cols = Unicode::GCString->new($str)->columns; $strings{$str} = $cols; my $pad = "." x ( 20 - $cols ); print "| $str$pad |\n"; } print Dumper( \%strings );
Download (untitled) / with headers
text/plain 101b
Note: In the terminal the ✏️line is aligned ok (on rt it looks like the 🤔does on the terminal)
Download (untitled) / with headers
text/plain 320b
The issue, I think, is that the author of the terminal program is going by this statement in UAX 11: When processing or displaying data ... [UTS51] emoji presentation sequences behave as though they were East Asian Wide, regardless of their assigned East_Asian_Width property value. But this routine doesn't do that.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.