<div dir="ltr"><div><div><div>Hi All, <br><br>I have the following program:<br><br>===============================================================<br><span style="font-family:courier new,monospace">procedure TForm1.Button1Click(Sender: TObject);<br>

begin<br>  if sd.Execute then begin<br>    if r.OpenKey('test_utf8', True) then begin<br>
//      r.WriteString('path', UTF8ToSys(sd.FileName));<br>      r.WriteString('path', sd.FileName);<br>      r.CloseKey;<br>    end;<br>  end;<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>


begin<br>  if r.OpenKey('test_utf8', False) then begin<br>//    ShowMessage('path=' + SysToUTF8(r.ReadString('path')));<br>    ShowMessage('path=' + r.ReadString('path'));<br>    r.CloseKey;<br>


  end;<br>end; </span><br>============================================================<br><br></div>It runs OK under windows whether I use SysToUTF8 or not, but on Linux, it crashes (SIGSEGV) on the line with r.ReadString.<br>

<br></div>I wonder what is the correct way to write a program that compile and run well under both Windows and Linux?<br><br></div>Thanks,<br>Shannon<br></div>