[fpc-pascal] Re: Real length of WideString

Zaher Dirkey parmaja at gmail.com
Thu Oct 21 02:28:04 CEST 2010


On Thu, Oct 21, 2010 at 1:41 AM, Zaher Dirkey <parmaja at gmail.com> wrote:

> How to get the real length of WideString variable.
>
>
Hmm, I think i found my problem but not understand it, i used Lazarus as
editor to write the code

var
  ws: widestring;
begin
  ws:= 'زاهر';
  Label3.Caption := inttostr(length(ws));
//= 8

It is different with

  ws:= UTF8Decode('زاهر');
  Label3.Caption := inttostr(length(ws));
//= 4


-- 
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20101021/71bf1c1b/attachment.html>


More information about the fpc-pascal mailing list