[fpc-devel] Unicode RTL
Kirinn
kirinn at mooncore.eu
Mon Jul 24 22:05:08 CEST 2023
Hi,
A "unicode" RTL is of course great for targeting legacy Windows platforms,
but for those of us on Linux, UTF-8 is the way. To this end, it would be
helpful to add a paragraph on the wiki page underlining how to retain the
single-byte RTL; or, if no user action is necessary, mention that, to set
minds at ease. Thank you for this hard work!
~Kirinn
On Mon, 24 Jul 2023 21:49:39 +0200 (CEST)
Michael Van Canneyt via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> Hello,
>
> I have just completed phase one of the "Unicode RTL" effort.
>
> The 'Unicode RTL' is an effort to be more Delphi compatible:
> - Char = Unicode Char and String = UnicodeString
> - Provide dotted filenames.
> Basically closer to the RTL as it exists in more recent versions of Delphi
> (essentially post - Delphi 2009)
>
> This RTL will co-exist with the current RTL (single-byte char, no dotted
> names), but will share the same codebase.
>
> More explanations can be found here:
>
> https://wiki.freepascal.org/FPC_Unicode_RTL
>
> This coexistence of 2 RTLs is accomplished with 'Subtarget support'.
>
> Subtarget support is a means to consistently apply a set of Free Pascal
> compiler settings to everything that you compile.
>
> Subtarget support is explained in more detail here:
> https://wiki.freepascal.org/FPC_Subtarget_Support
>
> While it is now used to create a unicode rtl, it could also be used to
>
> * create a llvm-compiled RTL.
> * create an rtl with debug info and one without.
> * compile the various Lazarus widgetsets into different directories
> * ... any other things you may think of ...
>
> all with a single installation of FPC.
>
> For the second part of the effort, 'provide dotted filenames', the actual
> work is finished, but still needs merging to trunk.
>
> This second part is expected to be merged in the next days/weeks.
>
> But today, using FPC trunk, you can now recompile the Free Pascal RTL,
> Packages and Utils (but not the compiler itself!) into a set of units where
>
> Char = UnicodeChar
> String = UnicodeString
>
> To compile (and install) the unicode rtl, all you need to do is follow the
> steps outlined in
>
> https://wiki.freepascal.org/FPC_Unicode_RTL
>
> Basically, this means creating a 2-line configuration file for the
> unicodertl subtarget, and compiling the RTL, packages and utils with
>
> make SUB_TARGET=unicodertl
>
> For those that need/want more delphi-compatible code, I would love to hear
> of your experience with the unicode rtl. I have done extensive testing, but
> as practice shows, there will always be cases which defy ordinary test
> cases...
>
> If the 2 wiki pages need more explanations, please let me know and I will do
> my best to improve the explanations.
>
> Hopefully, in the near future the compiler settings dialog in Lazarus will
> also allow you to specify a subtarget.
>
> Michael.
> _______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
More information about the fpc-devel
mailing list