in reply to Re^3: MD5 non ascii file name
in thread MD5 non ascii file name

I think the problem occurrs when you do stuff like:

use utf8; my $filename = "Söme Weird File"; open my $fh, "<", $filename or die;

Except that "ö" is likely still a valid character. The same happens with filenames read from an external file I guess.

Replies are listed 'Best First'.
Re^5: MD5 non ascii file name
by ikegami (Patriarch) on Aug 22, 2008 at 06:52 UTC

    But doesn't that error occur for both Windows and "other" systems? On both WinXP and linux, the following code generates the same 2-byte file name (interpreted according to the local codepage).

    open(my $fh, '>', chr(0x2660)) or die $!

    (Too lazy to find out how to encode ö.)

    So it appears that Perl passes the string's internal buffer to the system call. I don't see how that can be used to demonstrate that Perl assumes an encoding for the file name. Quite the opposite, it seems to show that Perl assumes file names are binary strings. It's up to the user to encode them.