How can I properly use environment variables encoded as Windows-1251 in Perl?
- by Kartlee
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-1252 → utf-8. When we call another process, should we convert back to Windows-1252 code page?