<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
osx fpc & lazarus svn QT x64<br>
my project's Compiler options has<br>
-FcUTF8<br>
-dEnableUTF8<br>
<br>
this is my code: this code work normal without ut8 params<br>
<br>
const<br>
WIN_EXE: String = 'MZ';<br>
LINUX_EXE: String = #127 + 'ELF';<br>
var<br>
wFileStr: TFileStream;<br>
ar: array[0..4] of byte;<br>
ExecType: char;<br>
wProgram := ParamStrUTF8(0);<br>
wFileStr := TFileStream.Create(wProgram, fmOpenRead);<br>
try<br>
wFileStr.Read(ar, 4); <b>--> problem is here ar array all
Item is 0, test width string, its return nil</b><br>
Finally<br>
wFileStr.Free;<br>
end;<br>
if CompareMem(@(ar), Pchar(WIN_EXE), 2) then ExecType := 'W'<br>
else if CompareMem(@(ar), Pchar(LINUX_EXE), 4) then ExecType := 'L'<br>
else Exit;<br>
<br>
</body>
</html>