<p>Am 30.07.2017 12:37 schrieb "Bo Berglund" <<a href="mailto:bo.berglund@gmail.com">bo.berglund@gmail.com</a>>:<br>
><br>
> On Sun, 30 Jul 2017 09:33:59 +0200, Sven Barth via fpc-pascal<br>
> <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
><br>
> >> The application was started back in Delphi7 times when "string"<br>
> >> actually meant AnsiString and was a 1-byte per element container.<br>
> ><br>
> >You could always use RawByteString or a string with a fixed codepage<br>
> >instead if plain AnsiString.<br>
><br>
> I asked about this problem over at Embarcadero too, but was flamed for<br>
> even thinking about using any kind of string for storing binary data.<br>
> THeyn did suggest RawByteString too, though so I went over the<br>
> application changing all buffers to RawByteString and it did work.<br>
> I also tried to set a fixed codepage for the application, but it is<br>
> hard to check if it actually does help.</p>
<p>Not a fixed codepage for the application, but a string with fixed codepage, e.g. "String(CP_1242)" or so...</p>
<p>> The root problem is what happens with string conversions on different<br>
> locales and some functions could not be easily modified to use<br>
> RawByteString.<br>
> So I decided to bite the bullet and convert the whole unit to TBytes<br>
> instead. Some 7000 code lines to go over...<br>
><br>
> It has taken a good many hours now and I still have some intricate<br>
> problems to solve. It still won't compile without errors.<br>
><br>
> ><br>
> >Just declare a type alias so that you can keep it compatible with older<br>
> >Delphi versions as well.<br>
> ><br>
><br>
> Do you mean:<br>
> type<br>
>   TMyString = RawByteString;</p>
<p>Yes.</p>
<p>Regards,<br>
Sven</p>