In our previous episode, Dani?l Mantione said: > >> If you want to help, we need to implement the Delphi 2009 encoding aware > >> string type, both runtime support as well as the compiler support. > > A previous discussion showed that this also breaks a lot of old code and is > > not really nice. > > As I understand it, the incompatibility from Delphi 2009 comes from the > fact that and char string by default has becomes 2 bytes, not by adding > encoding information to the type.
Yes. The added strings are perfectly compatible. (ansistring for 1 byte encodings unicodestring for 2 byte encodings) The incompatible part comes from switching the default string/char type to the 2 byte variants. > > So a better concept seems to have a dedicated type for any possible Coding > > (ANSISTring <of course locale-depending>, UTF8String, UTF16String, maybe > > UCS2String, too) and let the user choose (e.g. by a "{$" compiler option) > > which one he want to be used for "String" and "WideString". This would > > allow > > for simple compiler magic to perform any necessary conversion (including > > assigning constants). > > Isn't this the same?? Typing wise it is the same. (except for the nonexistance of UCS2), implementation wise not. But Michael obviously hasn't read the PDF. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel