btw, the problem occur if the input string is CJK.

2013/8/11 Xiangrong Fang <[email protected]>

> Hi All,
>
> I have the following program:
>
> ===============================================================
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>   if sd.Execute then begin
>     if r.OpenKey('test_utf8', True) then begin
> //      r.WriteString('path', UTF8ToSys(sd.FileName));
>       r.WriteString('path', sd.FileName);
>       r.CloseKey;
>     end;
>   end;
> end;
>
> procedure TForm1.Button2Click(Sender: TObject);
> begin
>   if r.OpenKey('test_utf8', False) then begin
> //    ShowMessage('path=' + SysToUTF8(r.ReadString('path')));
>     ShowMessage('path=' + r.ReadString('path'));
>     r.CloseKey;
>   end;
> end;
> ============================================================
>
> It runs OK under windows whether I use SysToUTF8 or not, but on Linux, it
> crashes (SIGSEGV) on the line with r.ReadString.
>
> I wonder what is the correct way to write a program that compile and run
> well under both Windows and Linux?
>
> Thanks,
> Shannon
>
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to