[fpc-pascal] Best way to insert bytes into a TBytes variable?

Michael Van Canneyt michael at freepascal.org
Wed Aug 2 09:29:53 CEST 2017



On Mon, 31 Jul 2017, Michael Schnell wrote:

> On 30.07.2017 12:37, Bo Berglund wrote:
>> I asked about this problem over at Embarcadero too, but was flamed 
>> foreven thinking about using any kind of string for storing binary data.
> They are silly and defending their completely silly implementation of 
> Code aware strings, forcing UTF-16 for any TStrings based classes.
>
> The fpc implementation (forcing UTF-8 for any TStrings based classes) is 
> slightly less silly.

Small correction:

FPC "forces" nothing. It offers a single-byte string TStrings implementation.
If you want to use that for Unicode, you indeed have no choice but to use UTF8
or use/write a separate class that uses UTF16.

Michael.



More information about the fpc-pascal mailing list