[fpc-devel] SysUtils.GetEnvironmentVariable(String) still uses GetEnvironmentVariableA

Denis Kozlov dezlov at gmail.com
Mon May 23 14:31:11 CEST 2016


Hi,

In FPC 3.0.0 and TRUNK for Windows:
> SysUtils.GetEnvironmentVariable(String) uses GetEnvironmentVariableA
> SysUtils.GetEnvironmentVariable(UnicodeString) uses GetEnvironmentStringsW

GetEnvironmentVariableA produces a result crippled by ANSI/OEM. Can it be
replaced with a simple typecast of UnicodeString based function:

function GetEnvironmentVariable(const EnvVar: String): String;
begin
  Result := String(GetEnvironmentVariable(UnicodeString(EnvVar)));
end;

Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160523/9b4769d3/attachment.html>


More information about the fpc-devel mailing list