in reply to Re: Unicode (utf8) does not pass correctly to Windos system call.
in thread Unicode (utf8) does not pass correctly to Windos system call.

It is encoded. The print command does display correctly. I did try your code snippet, but it still does not work.
  • Comment on Re^2: Unicode (utf8) does not pass correctly to Windos system call.

Replies are listed 'Best First'.
Re^3: Unicode (utf8) does not pass correctly to Windos system call.
by moritz (Cardinal) on Nov 16, 2009 at 16:05 UTC
    It is encoded. The print command does display correctly.

    It's not encoded. The print goes to STDOUT, to which you have applied an encoding IO layer.

    Anyway, if you have the option to change the C# program, try communicating by a pipe instead of passing it as a command line argument. That should work more platform independent.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re^3: Unicode (utf8) does not pass correctly to Windos system call.
by ikegami (Patriarch) on Nov 16, 2009 at 16:29 UTC

    It is encoded. The print command does display correctly

    That's because you do encode what you send to STDOUT (via binmode).

    I did try your code snippet, but it still does not work.

    It does what you asked. Maybe you asked the wrong question?

      I realized I posted an error in the perl code above. I corrected that (Just had some inconsistent string names when I simplified the example.) I will try and clarify my question.

      The output of the perl print statement is what I expect. The print command is correctly displayed in the uft8 encoding, however the encoded string is not encoded when it is passed through the system command to the C# application on windows. I'll try and post what I'm seeing.

      Output of perl program.
      >perl test.pl
      >Sent Ħis. Ŧ good
      >Received Ħis. Ŧ good

      Output of C# application when run by itself with the same encoded string argument that the perl program should pass to it.
      >Example.exe Ħis. Ŧ good
      >Received Ħis. Ŧ good


      By itself the C# program does display a utf8 encoded string if passed to it from the windows command prompt. On a linux system the perl script does work and the C# application receives the utf8 encoded string from the perl system() call.

      If I run the perl script on linux I get this output which is what I want.
      >perl test.pl
      >Sent Ħis. Ŧ good
      >Received Ħis. Ŧ good