On Mon, Apr 9, 2012 at 11:18 AM, Marco van de Voort <mar...@stack.nl> wrote:
> 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))

Yes, both are valid and do not have problem with the RTL. It was
designed to work using AnsiString, we know that... but these problems,
on Windows, is very dangerous to developer, don't you think?

Unfortunately I did not followed all discussion about Unicode,
cpstrnew, FPC trunk, etc because I could not help at this level so,
I'm waiting a solution since.

Marcos Douglas

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to