[fpc-devel] GetEnvironmentVariable

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Apr 13 13:08:43 CEST 2017


Hi,

Under Windows GetEnvironmentVariable(AnsiString) uses the
winapi function GetEnvironmentStringsA.

Why not simply:

Result:=String(GetEnvironmentVariable(UnicodeString(EnvVar)));

?

This would save some code and would work with another
DefaultSystemCodepage as well.

Mattias



More information about the fpc-devel mailing list