How can I properly use environment variables encoded as Windows-1251 in Perl?

Posted by Kartlee on Stack Overflow See other posts from Stack Overflow or by Kartlee
Published on 2010-03-13T09:39:09Z Indexed on 2010/03/17 3:11 UTC
Read the original article Hit count: 499

Filed under:
|
|

I have an environment variable set in Windows as TEST=abc£ which uses Windows-1252 code page. Now, when I run a Perl program test.pl this environment value comes properly.

When I call another Perl code - test2.pl from test1.pl either by system(..) or Win32::Process, the environment comes garbled.

Can someone provide information why this could be and way to resolve it?

The version of perl I am using is 5.8.

If my understanding is right, perl internally uses utf-8, so the initial process - test1.pl received it right from Windows-1252utf-8. When we call another process, should we convert back to Windows-1252 code page?

© Stack Overflow or respective owner

Related posts about perl

Related posts about character-encoding