note
haukex
<blockquote><i>but unable to delete these in other language</i></blockquote>
<p>Please see [id://174051] and show us an [id://1177642|SSCCE] with which we can reproduce the problem on our end. I'd have to guess that maybe it has something to do with the encoding of the file containing the list of files, see e.g. [mod://encguess] for a way to find out how it's encoded. The following works for me, my terminal is entirely UTF-8. Note how I specify the file's encoding in the [doc://open].</p>
<pre>
$ touch 'jdid rai dz cheb mourad 2017- No No No Madamti new album شاب مراد كالعادة يصرع'
$ touch '✪ Lotfi Double Kanon✪ 2017 جديد ⁄ أنا'
$ ls jdid* *Lotfi* >list.txt
$ cat list.txt
jdid rai dz cheb mourad 2017- No No No Madamti new album شاب مراد كالعادة يصرع
✪ Lotfi Double Kanon✪ 2017 جديد ⁄ أنا
$ encguess list.txt
list.txt UTF-8
$ perl -wMstrict
open my $fh, '<:encoding(UTF-8)', 'list.txt' or die $!;
chomp( my @files = <$fh> );
close $fh;
my $count = unlink(@files);
print "Deleted $count files\n";
__END__
Deleted 2 files
$ ls
list.txt
$
</pre>
1195063
1195065