Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Non asci character and system call

by Anonymous Monk
on Nov 09, 2017 at 07:39 UTC ( #1202998=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1202998]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2021-05-15 02:27 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.