in reply to Re^4: Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?
in thread Any good ways to handle NARROW NO-BREAK SPACE characters in regex in newer versions of Perl?
use utf8; has no effect in that program since it's encoded using ASCII. But it doesn't hurt since ASCII is a subset of UTF-8.
The issue is that get_all_files_in_dir is matching against the still-encoded file names.
The second program is effectively doing
my $fn = "Screenshot-2024-02-23-at-1.05.14\xE2\x80\xAF"; $fn =~ /Screenshot-2024-02-23-at-1.05.14\s/
That will only match if U+E2 is a space character, and it isn't.
|
---|