[fpc-devel] String constant without code page
Sven Barth
pascaldragon at googlemail.com
Thu Dec 14 13:27:29 CET 2017
Am 14.12.2017 09:37 schrieb "Petr Kristan" <petr.kristan at epos.cz>:
Hi.
I compile whole project with -FcUTF8, but sometimes should be useful
to define string constant with CP_NONE to prevent conversions.
Example:
DefaultSystemCodePage:=1250
variable s contains text with cp=1250
s := s + '#'; //conversion because '#' has cp=65001
Is possible to define '#' without cp?
Or is possible to do fast string concatenation without conversion?
A concatenation is done without conversion if all strings have the same
code page. You can enforce the code page using SetCodePage() which has a
parameter to not convert the string to that code page. You can retrieve the
code page using StringCodePage().
See also:
https://www.freepascal.org/docs-html/rtl/system/setcodepage.html
https://www.freepascal.org/docs-html/rtl/system/stringcodepage.html
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20171214/3ee596a5/attachment.html>
More information about the fpc-devel
mailing list