[fpc-pascal] Real length of WideString

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Oct 21 09:00:07 CEST 2010


Op 2010-10-21 08:29, Graeme Geldenhuys het geskryf:
> 
> Length() returns number of bytes, not number of characters. The incorrect
> assumption was made back in Delphi (before unicode support).

>From Delphi 7 & Kylix 3 help:

"For single-byte and multibyte strings, Length returns the number of bytes
used by the string. For Unicode (WideString) strings, Length returns the
number of bytes divided by two."


FPC help does not specify what the value is that Length() returns - bytes
or characters. So I default to the Delphi/Kylix help.



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net:8080/fpgui/




More information about the fpc-pascal mailing list