[fpc-devel] Save the current FPC UnicodeString!
Florian Klaempfl
florian at freepascal.org
Thu Nov 12 22:44:58 CET 2009
dmitry boyarintsev schrieb:
> On Thu, Nov 12, 2009 at 9:26 PM, Florian Klaempfl
> <florian at freepascal.org> wrote:
>> Ansistring: system encoding
>> RawByteString: variable encoding, cannot be checked at compile time,
>> when working with RawByteStrings, you've to take care of the newly
>> introduced encoding field
>
> Let's say there's a library that works with AnsiString as a string
> type with no encoding (as it's now).
Well, an ansistring has an implicit encoding: system. This won't change
and if one uses only unicodestrings and ansistrings, no change will be
noticed.
> Let's assume that the new branche is officially accepted.
> The library doesn't want the new feature, but it also doesn't want to
> change its code from AnsiString to RawByteString.
>
> Would it be possible to make the following type declaration:
>
> unit MainLibTypes;
>
> type
> AnsiString = RawByteString;
>
> to avoid using new auto-converters?
No, because it would avoid auto-conversion from/to unicodestring as well.
More information about the fpc-devel
mailing list