Windows has two set of system calls: "A"NSI and "W"ide.
Perl's file functions use the "A" version of the system call, so the UTF-8 encoding of the string you pass to them is interpreted as being encoded according to the system's code page (e.g. American systems typically use cp1252, Microsoft's version of iso-latin-1).
One way to achieve your goal is to encode the file name according to the system's code page.
#!/usr/bin/perl use utf8; use Encode qw( encode ); use Win32::Codepage; mkdir encode(Win32::Codepage::get_encoding(), 'Ïntêràtíonaliçzation');
That method assumes the characters you are using are present in your system's code page. If they are not, you will need to use the "W" version of the function. The "W" function accepts UCS-2le strings which can encode common UNICODE characters. Unfortunately, I don't think there currently exists a module that gives access to those functions, but you could access them via Win32::API.
In reply to Re: Mkdir and utf8
by ikegami
in thread Mkdir and utf8
by perlmonkdr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |