[fpc-devel] Unicode resource strings
Sven Barth
pascaldragon at googlemail.com
Tue Aug 21 17:21:27 CEST 2012
Am 21.08.2012 16:44, schrieb Mattias Gaertner:
> On Tue, 21 Aug 2012 15:11:56 +0100
> Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
>
>> 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.
>
> length returns the number of characters.
> UTF8Length the number of codepoints.
> There must also be a function to return the number of bytes.
> Does someone know the name?
Length(s) * SizeOf(s[1])
Regards,
Sven
More information about the fpc-devel
mailing list