[fpc-devel] Unicode RTL

Daniël Mantione daniel.mantione at freepascal.org
Wed Nov 16 12:03:32 CET 2005



Op Wed, 16 Nov 2005, schreef Marco van de Voort:

> > Please check this discussion:
> > 
> > http://community.freepascal.org:10000/bboards/message?message_id=172880&forum_id=24092
> > 
> > Short summary:
> > * Many places in the rtl use single character strings, i.e. ansistrings.
> > * To make them Unicode proof they need to be changed into wide strings.
> > * But this could break a lot, and add a lot of overhead.
> > 
> > To be short, Juras B. wants to add a Unicode Win32 target, so in the 
> > standard RTL things like Tlist etc. use ansistrings, while in the Unicode 
> > RTL they use widestrings.
> > 
> > IMHO this is indeed a good solution, but one with consequences. Could 
> > somebody give his opinion?
> 
> IMHO the problem is that the principle of the target dependant dir structure
> is that there is an separation between OS and non-OS dependant code,
> allowing to reuse the OS independant code. 
> 
> However this doesn't work fully this way, since unicode internally also hits
> OS-independant code hard. IOW the separate target only solves the windows
> unit defaults.

Indeed. What is proposed is that the system independent RTL uses an 
abstract string type (Tnativestring) which is widestring or ansistring 
depending on target.

What should be done on Linux/FreeBSD/MacOS is still unknown to me, it is 
a wild west, but likely something similar, internally a widestring rtl is used that 
converts to the right encoding when communicating externally.

Daniël


More information about the fpc-devel mailing list