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


in reply to Re^2: Non asci character and system call
in thread Non asci character and system call

Works for me. Is your $commandline as simple as shown? It may have characters outside of ANSI CP, or characters that need escaping (quoting). Try pasting its content directly to command prompt and see if it's working. Or maybe file is not in current directory.

use strict;
use warnings;
use feature 'say';
use utf8;
use Encode 'encode';
use Win32;

say Win32::GetACP;      # 'ANSI Code Page'
say Win32::GetOEMCP;    # 'OEM Code Page'

my $commandline = qq{start "" "сервис.pdf"};
system( encode 'CP'. Win32::GetACP, $commandline ) == 0
or die encode 'CP'. Win32::GetOEMCP, qq{Couldn't launch '$commandline': $!/$?};