Not 100% on this but I think the gist is that UnicodeString is compatible with AnsiString and a conversion is done on assignment.
-- Alexander Grotewohl https://dcclost.com ________________________________ From: fpc-pascal <fpc-pascal-boun...@lists.freepascal.org> on behalf of Ryan Joseph via fpc-pascal <fpc-pascal@lists.freepascal.org> Sent: Tuesday, October 6, 2020 12:39:43 PM To: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org> Cc: Ryan Joseph <generic...@gmail.com> Subject: Re: [fpc-pascal] Adding file to string to the RTL > On Oct 6, 2020, at 2:12 AM, Michael Van Canneyt via fpc-pascal > <fpc-pascal@lists.freepascal.org> wrote: > > I added the following functions to the sysutils unit (rev 47056): Great, thanks Michael. I've always used AnsiString so why is UnicodeString preferable here? So is the idea we need to specify an UTF-8 encoding for unicode otherwise it assumes ASCII format? I didn't specify the encoding with TStringList and I always seemed to get back what I wanted (maybe it sniffed the encoding from the file?). Regards, Ryan Joseph _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal