Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1202998]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-11-18 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?