[fpc-pascal] Concatenating CP Strings

Martok listbox at martoks-place.de
Sun Sep 16 15:48:49 CEST 2018

Am 16.09.2018 um 14:31 schrieb Jonas Maebe:
> [...snip...]
Thank you very much for this explanation! One for the bookmarks.

It just seems very odd to me to have the incredibly powerful and useful dynamic
codepage concept... and then trash it on every assignment.
But if that was an Emba-invention, that explains a few things...

Concrete example: the MS RC script format allows changing the input codepage at
runtime (#pragma code_page), meaning the next #include must be interpreted in
that CP, and output generated from this input must be in that CP (unless it is
written in widestring format, but that is decided very late in the process).
This would be super easy to do if one could just pass around a string with the
correct dynamic code page (one could even use the CP_UTF16 codepage for L"foo"
widestrings). But as fcl-res uses AnsiStrings everywhere, this cannot work, as
the only lossless setting would be to use DefaultSystemCodePage=UTF8 for the
entire program, completely ignoring the user, which might cause MUI problems.

Windres gets this wrong as well, but somehow that doesn't really make me feel
any better ;-)


More information about the fpc-pascal mailing list