[fpc-pascal] Casting UTF8String, WideString and UnicodeString into AnsiString and vice versa

ik idokan at gmail.com
Mon Dec 3 20:01:49 CET 2012


On Mon, Dec 3, 2012 at 7:31 PM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>
> On 03 Dec 2012, at 18:12, ik wrote:
>
>> I made casting of UTF8String, WideString and UnicodeString to AnsiString:
>> https://github.com/ik5/fp-msgpack/blob/master/src/msgpack.pas#L452
>>
>> As an example.
>>
>> My tests works. but are there things/contents that can break this
>> casting, or change the content itself in some way ?
>
> It creates a new temporary string with the default code page for that string type (e.g., DefaultSystemCodePage for ansistring), and converts the original string's content to this new encoding.

Isn't that only 2.7.1 feature ?!

>
>
> Jonas_______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list