The typecase will not help you, since the result is an ansistring.
The result will still be crippled.
The only solution for this is a unicode RTL.
Michael.
On Mon, 23 May 2016, Denis Kozlov wrote:
P.S. A minor typo, GetEnvironmentVariableA should read
GetEnvironmentStringsA.
On 23 May 2016 at 13:31, Denis Kozlov <dez...@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
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel