[fpc-devel] new string - question on usage

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Oct 13 14:08:09 CEST 2011


Michael Schnell schrieb:
> On 10/13/2011 10:52 AM, Sven Barth wrote:
>>
>>> So you suggest that in Delphi XE, UnicodeString is _not_ a "new String"
>>> Type ?
>>
>>
>> I don't know what you describe as "new string", but "UnicodeString" 
>> was introduced as a new type in Delphi 2009 and "String" was made an 
>> alias to "UnicodeString". If you want to use the code page aware 
>> string, then you need to use "AnsiString(xyz)" which is no longer used 
>> for "String".
>>
> The question was: "in XE, is UnicodeString not a "code page aware" 
> String (under the hood) ?" (No question about usage, FPC, or D2009 or 
> alias to "string".)

An UnicodeString has UTF-16 (cp 1200) encoding, of course. And it is 
codepage-aware, but you cannot derive further types with different 
encoding from it, as you can do from AnsiString.

DoDi




More information about the fpc-devel mailing list