http://www.perlmonks.org?node_id=1202998


in reply to Non asci character and system call

After testing all proposed approaches listed here (thanks), the only one that seems to work is the following

use strict; use utf8; use Win32::Unicode::Process; my $DocumentPath="внес.pdf"; my $commandline = qq{start "$DocumentPath" "$DocumentPath"}; systemW($commandline ) == 0 or die qq{Couldn't launch '$commandline': $!/$?};

With "cp".Win32::GetACP(); I could detect that my machine (Windows 10) is using CP1252; cmd is able to handle cyrillic (I hust can past in it any Russian word I want); systemW pass the filename to cmd and it is visualized correctly; all others produced a word salad.

What I DON'T like is the necessity to rely on an external module for such a (for sure complex) but also basic operation, at least in my eyes. The fact that the module's author states "THIS MODULE IS ALPHA LEVEL AND MANY BUGS." doesn't make me feel much better. Furhermore, the fact that I want my script to be "machine indipendent", i.e. be able to run on any Windows with different locale/encodings without having to manually adapt it, give me the feeling "just let's hope that it will run". Not good feeling.

Replies are listed 'Best First'.
Re^2: Non asci character and system call
by Anonymous Monk on Nov 09, 2017 at 07:49 UTC

    my $DocumentPath="внес.pdf"; is what I was testing. Perlmonks converted it while publishing my comment.