[fpc-devel] new string - question on usage

Michael Schnell mschnell at lumino.de
Wed Oct 12 10:24:57 CEST 2011


On 10/12/2011 10:09 AM, Paul Ishenin wrote:
> 12.10.2011 16:03, Michael Schnell wrote:
>> I suppose a variable of the type "String" is pre-loaded with the
>> predefined "System" encoding ID.
>
> If you mean "AnsiString" then it is loaded with encoding 0 which means 
> default system codepage. It will get the real encoding number after 
> the first assignment.
>
I understand that some day (when the official release comes up) "String" 
will be a new String type and thus ANSIString obsolete and just an alias.

So target encoding ID "0" means that " := " will preserve the encoding 
of the source and set the target appropriately without doing a conversion.

Any other encoding ID will be unmodified in the target and a conversion 
will be done if appropriate. (supposedly no conversion when the target's 
encoding ID is "Raw").

Seems clever but not easy stuff to understand. :)

-Michael



More information about the fpc-devel mailing list