[fpc-devel] Ansistring code page

Flávio Etrusco flavio.etrusco at gmail.com
Fri Oct 14 00:29:13 CEST 2011


On Thu, Oct 13, 2011 at 7:13 PM, Paul Ishenin <webpirat at mail.ru> wrote:
> 13.10.2011 21:21, Jonas Maebe wrote:
>>
>> This I don't really understand.
>
> This is how delphi works according to my tests. I will retest to be 100%
> sure.
>
>> Shouldn't the constant be converted at run time from UTF-8 to the
>> DefaultSystemCodePage to make sure that an ansistring(0) variable always
>> contains strings encoded in the DefaultSystemCodePage? If you assign e.g. a
>> string(866) variable to a plain ansistring variable, then such a conversion
>> is also done, no?
>
> Best regards,
> Paul Ishenin

Does this also happen if the string contains non-ASCII chars? If it
doesn't, the first case seems like a fine optimization to me ;-)

-Flávio



More information about the fpc-devel mailing list