Re: Unicode filenames on NTFS using Perl

Michael Ludwig <[email protected]> Wed, 11 Jan 2012 21:35:28 +0100
Newsgroups gmane.comp.lang.perl.active-perl
Message-ID <20120111203528.GA844@Dago>
[email protected] schrieb am 11.01.2012 um 08:58 (+0100):
> Hi,
> have a look on Win32::Unicode.
> For me it solves the problems with file/directory names not
> representable in the current code page. 
> Don't forget operators like '-f', '-d', '-s', '-r', ... when you
> change the code.

https://metacpan.org/module/Win32::Unicode

Excellent! For me, it also solves another problem:

Unicode on Windows Console
http://www.mail-archive.com/[email protected]/msg03047.html

perl -MWin32::Unicode -lwe "printW qq(I \x{2665} Perl)"

I ♥ Perl

And it creates files and directories, too. Error handling appears
to be still a bit shaky.

use utf8;
use strict;
use warnings;
use Win32::Unicode;

for ( map "$_-3", qw/ Волгоград москва / ) {
	print "***\n";
	eval { mkdirW $_ or warn "mkdirW $_: $!" };
	warn if $@;
}

Danke,

Michael
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs