[Lazarus] -FcUTF8,-dEnableUTF8 create problem

FreeMan freeman35 at delphiturkiye.com
Thu Feb 19 09:30:48 CET 2015


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;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150219/9b12db80/attachment-0002.html>


More information about the Lazarus mailing list