[fpc-devel] Some questions and proposals about cpstring
Sven Barth
pascaldragon at googlemail.com
Wed Oct 12 14:46:13 CEST 2011
Am 12.10.2011 14:42, schrieb Alex Shishkin:
> 12.10.2011 16:34, Hans-Peter Diettrich пишет:
>> Alex Shishkin schrieb:
>>> 1) Why UTF8String made incompatible with AnsiString(CP_UTF8)
>>> ( UTF8String = type AnsiString(CP_UTF8); )? Why not an alias?
>>
>> An alias allows to assign strings of *any* encoding, with possibly fatal
>> consequences. A strict UTF8String type allows for implicit conversion,
>> whenever required, so that such a string can contain nothing but UTF-8
>> encoded characters.
> So if I declare "MyString : AnsiString(CP_UTF8)" and assign win1251
> encoded string to it no conversion will be made? It`s strange.
Huh? No, of course there will be a conversion. I don't know what DoDi is
worried about here.
Regards,
Sven
More information about the fpc-devel
mailing list