[fpc-devel] String and UnicodeString and UTF8String

Sven Barth pascaldragon at googlemail.com
Wed Jan 12 19:45:31 CET 2011


On 12.01.2011 13:38, Hans-Peter Diettrich wrote:
> Jeff Wormsley schrieb:
>> On 01/11/2011 11:10 AM, Hans-Peter Diettrich wrote:
>>>
>>> UTF-8 combines an single (byte-based) storage type with lossless
>>> encoding of full Unicode. Ansi and UCS2 (really UTF-16) only *look*
>>> easier to handle in user code, but both will fail and require special
>>> code whenever characters outside the assumed codepage may occur.
>>
>> Preface: I don't write international apps, and probably won't for the
>> foreseeable future...
>
> Then you may be bound to some legacy compiler version when the
> stringhandling will change in some future time, as happened to Delphi
> users. Continued support of AnsiString type(s) is not enough, because
> legacy code can be broken by (eventually) required changes to "set of
> char", sizeof(char) and PChar, sizeof(string) as opposed to
> Length(string), upper/lower conversion, and many more not so obvious
> consequences.

I don't believe that PChar will be touched, because to much code that 
interfaces with C code depends on that. Although its declaration might 
not be the same then and become "PChar = PAnsiChar" instead of "PChar = 
^Char" if Char is changed (currently its "PAnsiChar = PChar").

Regards,
Sven



More information about the fpc-devel mailing list