[fpc-devel] new string - question on usage

Sven Barth pascaldragon at googlemail.com
Wed Oct 12 14:09:00 CEST 2011


Am 12.10.2011 14:07, schrieb Michael Schnell:
> On 10/12/2011 01:53 PM, Hans-Peter Diettrich wrote:
>>
>> All AnsiString types have an element size of 1, UnicodeString has 2
>> and UCS4String has 4 bytes per element.
> Disregarding whether or not this makes sense: what technology enforces
> this (e.g. Compiler Magic or RTL) ?

Basically both, as both rely on and use the fact that "AnsiString[i] = 
AnsiChar" and "SizeOf(AnsiChar) = 1" and also "UnicodeString[i] = 
UnicodeChar" and "SizeOf(UnicodeChar) = 2".

Regards,
Sven




More information about the fpc-devel mailing list