[fpc-devel] Unicode resource strings

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Aug 21 16:11:56 CEST 2012

On 21 August 2012 14:54, Marco van de Voort <marcov at stack.nl> wrote:
> Doesn't sound wise.  length(stringtype)=n should mean that the string takes
> sizeof(char)*n bytes. (give or take the #0#0)

I'm not sure what you are trying to accomplish? Give me sample code
that will cause a problem.

In fpGUI I have UTF8Length(mystring) which returns the actual number
of code points used - not bytes used. If you want the number of bytes
used, simply use Length(mystring).  Use each of those at appropriate
times based on what you want to accomplish.

The RTL Length() function has been the source of lots of confusion to
Delphi and FPC developers. So without an actual use-case I don't know
what you are trying to do.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the fpc-devel mailing list