[Lazarus] Unicode on Windows

Marcos Douglas md at delfire.net
Mon Apr 9 14:37:16 CEST 2012


On Mon, Apr 9, 2012 at 9:19 AM, Felipe Monteiro de Carvalho
<felipemonteiro.carvalho at gmail.com> wrote:
>
> On Mon, Apr 9, 2012 at 2:04 PM, Marcos Douglas <md at delfire.net> wrote:
> > Ops... you're right.
> > I was confused because IncludeTrailingPathDelimiter is part of RTL and
> > it not works with UTF8. The code uses Length and Result[l]... so, I
> > thought this is would be problem.
>
> Some routines made for Ansi work automatically with UTF-8 without
> changes. Simply using Length and Result[] by itself might sometimes be
> correct, if those are ment to access only chars <= #$7F like #10 and
> #13 are.

Lenght function do not works with UTF8 correctly.

procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit1.Text := 'ábç';
  ShowMessage(IntToStr(Length(Edit1.Text)));
end;

The result is 5 not 3, but you did know this of course.

Marcos Douglas




More information about the Lazarus mailing list