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

Denis Kozlov dezlov at gmail.com
Mon May 23 14:33:36 CEST 2016


P.S. A minor typo, GetEnvironmentVariableA should read
GetEnvironmentStringsA.


On 23 May 2016 at 13:31, Denis Kozlov <dezlov at gmail.com> wrote:

> 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/b3422add/attachment.html>


More information about the fpc-devel mailing list