[Lazarus] Unicode on Windows

Marcos Douglas md at delfire.net
Sun Apr 8 04:49:42 CEST 2012


Hi,

Using FPC 2.6.1 and Laz trunk on Windows, there is a better way to not to
do such codes below?

Examples
1- I'm on the LCL and I have an Edit (edtFileName):
var
  lFileName: string;
  lStrings: TStrings;
begin
  lStrings := TStrings.Create;
  try
    lFileName := Utf8ToSys(edtFileName.Text);
    lStrings.SaveToFile(lFileName);
  finally
    lStrings.Free;
  end;
end;

2- If I want to add the path delimiter using an Edit (edtPath)
var
  lPath: string;
begin
  lPath :=
SysToUtf8(IncludeTrailingPathDelimiter(Utf8ToSys(edtPath.Directory)));
  edtPath.Directory := lPath;
end;


Marcos Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120407/a4520ec3/attachment-0002.html>


More information about the Lazarus mailing list