[Lazarus] Unicode on Windows

Marco van de Voort marcov at stack.nl
Mon Apr 9 16:18:20 CEST 2012


On Mon, Apr 09, 2012 at 09:37:16AM -0300, Marcos Douglas wrote:
> 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.

Both are valid results. The first is needed when you copy the string (bytes
to move) the second to display the string (since it will probably be around
3 glyphs (yes, I know that is not guaranteed))





More information about the Lazarus mailing list