Skip Menu |

This queue is for tickets about the Text-Tabs+Wrap CPAN distribution.

Report information
The Basics
Id: 95823
Status: new
Priority: 0/
Queue: Text-Tabs+Wrap

Owner: Nobody in particular
Requestors: ether [...]
KENTNL [...]

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

Subject: Default $break statement should not include 0xA0 ( Nonbreaking space ) or 0x202f ( Narrow no-break space )
perl -E' say q[match] if chr(0xA0) =~ /^\s$/ '
Show quoted text
# match

Accoding to perldoc perlrecharclass, \s matches very many things which may not be considered "breakable spaces" in unicode strings, importantly:

 0x00a0              NO-BREAK SPACE   h s
 0x202f       NARROW NO-BREAK SPACE   h s

Attached is an example which generates a UTF8 string with no-break space in it, showing how it presently wraps, with a proposed replacement default regex ( moritz++ ) that excludes those 2 characters from being breaking characters.
text/x-perl 483b
#!/usr/bin/env perl # ABSTRACT: Wrap text use strict; use warnings; use utf8; use Text::Wrap; my $sample = join chr(0xA0) , qw( this is a statement that should not wrap ever ); utf8::upgrade($sample); my $string = join q[ ], ( $sample ) x 20; if ( $sample =~ /\s/ ) { print "Sample contains space!\n"; } print "\n"; print wrap(" - ", " >", $string ); print "\n"; $Text::Wrap::break='(?![\x{00a0}\x{202f}])\s'; print "\n"; print wrap(" - ", " >", $string ); print "\n";

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

Please report any issues with to