This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use GetEnvironmentStringsW(..) instead of GetEnvironmentStringsA(..).
GetEnvironmentStringsA(..) return strings in the OEM code page. This
can actually mangle the environment strings if it contain special characters.
A better approach would be to get the utf-16 strings through GetEnvironmentStringsW(..)
and convert them to ANSI code page. This is now done by win32_getenvironmentstrings(..).
To free the block, you can use win32_freeenvironmentstrings(..).