It looks like readdir is returning a latin1 encoding of the name. This leaves the interesting question of what it would do with some name that isn't representable in latin1.
As BrowserUK indicated, the error indicates that the string in your source file is not encoded as a utf8 string. If your editor is capable of using utf8, you can still use it in your program. For example, in vim ":set encoding=utf8". That will work, but may not convert pre-existing non-ascii characters.
I tried a test with File::Find, and finddepth seemed to work okay.
If you want to display non-ASCII data in a DOS box, you need to convert it to the correct code page. Here's an example program:
#!perl -w use Encode; use utf8; my $test = "This is a test. Gödel"; my $cp = `chcp`; # get code page from DOS CHCP command if ($cp =~ /(\d+)/) { $cp = "cp$1"; } else { $cp = "cp437"; } binmode STDOUT, ":encoding($cp)" or die "Error on binmode: $!"; print STDOUT "$test\n";
In reply to Re: Unicode (ä, ö, ü in German) Problem with File::Find under Windows2000
by Thelonius
in thread Unicode (ä, ö, ü in German) Problem with File::Find under Windows2000
by TeddyC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |