[Lazarus] String vs WideString

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Aug 16 11:08:23 CEST 2017


On 2017-08-16 09:43, Michael Schnell via Lazarus wrote:
> IMHO, any implementation of TStrings that forces a conversion (just
> because the class uses TStrings and not due to a logical demand), is a
> contradiction to providing code aware strings at all.

But in FPC 3.x (using modern compiler modes - not TP or Mac) String = 
UnicodeString. So it makes sense that TStrings should use UnicodeString 
internally to store its data. The Unicode standard is also the only 
standard that can support any language. So all Windows code-pages can be 
supported with the single UnicodeString type.

Are you suggesting that internally TStrings should have different 
storage for all possible languages, or some RawByteString type? So if 
you load some non-Latin code-page text internally it still stores that 
text as that non-Latin bytes? That would just over-complicate the 
TStrings class. FPC is moving towards UnicodeString being used 
internally for everything in the RTL, so why must TStrings be any different.

Regards,
   Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list