[fpc-devel] Array of char

Florian Klämpfl florian at freepascal.org
Wed Feb 25 20:53:06 CET 2015

Am 25.02.2015 um 19:03 schrieb Jonas Maebe:
> On 25/02/15 18:50, Florian Klämpfl wrote:
>> Am 25.02.2015 um 18:40 schrieb Jonas Maebe:
>>> A regular array of char can also be converted into a string in FPC.
>>> That's not a "raw pointer typecast" though, but an actual conversion
>>> whereby a new string "instance" is created based on the contents of the
>>> array.
>>> Maybe we have to do that too for dynamic arrays. Can you print the value
>>> of the array pointer and the typecasted string pointer? If they are
>>> different, then that's something else and we indeed probably also have
>>> to insert a type conversion.
>> This is also what I suspected but in this case the meta data would be available?
> Yes, but just very maybe the "0" code page was from CP_ACP. Although
> afaik Delphi always substitutes the actual value of
> DefaultSystemCodePage in instantiated strings, so that's probably not
> the case.

That's why I asked to print the result of StringElementSize :)

More information about the fpc-devel mailing list