in reply to Non asci character and system call

Hello Anonymous Monk,

I do not have a WindowsOS to test your code, but I tried it on a LinuxOS that I am having and seems to work with my pdf viewer (okular). Try something like that:

#!/usr/bin/perl
use utf8;
use strict;
use warnings;
use open ':std', ':encoding(UTF-8)';

my $commandline = qq{start "" /max "c:\сервис.pdf"}; # full screen
system($commandline) == 0
    or die qq{Couldn't launch '$commandline': $!/$?};

I think you have not defined correctly the path. Let us know if it worked.

BR / Thanos

Seeking for Perl wisdom...on the process of learning...not there...yet!

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

    Hi Thanos, nope, your code always fires "Couldn't launch". PS: Windows opens an error message saying that it was not possibile to find the file. Interesting enough the name of the file is a word salad. There must have to do with the encoding, but I have no clue.

        Yes, I've seen it as many (really many) other posts connected to encodings and Perl.

      Hello again Anonymous Monk,

      Try to run the command manually from the command line:

      start "" /max "c:\сервис.pdf"
      

      Experiment until the command it self works. After that you should be able to add it and work out of the box.

      Let us know if you manage to make it work, so other can benefit in similar cases.

      BR / Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!

        From the command line I have no problem at all! There must be some encoding issue somewhere, the problem is I don't understand where...I'll keep on trying to find a solution.