osx fpc & lazarus svn QT x64
my project's Compiler options has
-FcUTF8
-dEnableUTF8

this is my code: this code work normal without ut8 params

const
  WIN_EXE: String = 'MZ';
  LINUX_EXE: String = #127 + 'ELF';
var
  wFileStr: TFileStream;
  ar: array[0..4] of byte;
  ExecType: char;
 wProgram := ParamStrUTF8(0);
 wFileStr := TFileStream.Create(wProgram, fmOpenRead);
 try
wFileStr.Read(ar, 4); *--> problem is here ar array all Item is 0, test width string, its return nil*
 Finally
   wFileStr.Free;
 end;
 if CompareMem(@(ar), Pchar(WIN_EXE), 2) then ExecType := 'W'
 else if CompareMem(@(ar), Pchar(LINUX_EXE), 4) then ExecType := 'L'
      else Exit;

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to