[fpc-pascal] Summary of Unicode Strings Debate
Mazo Winst
mazofeifer at gmail.com
Wed May 11 15:34:10 CEST 2016
Hello,
A summary of what i learned from the Unicode String debate:
1 - FPC 3 introduces code page aware strings
2 - FPC 3 updates the RTL to provide a better support for code page aware
strings
3 - The dynamic behavior of the string type regarding to the platform was
not introduced by FPC 3. In the previous versions of FPC, the string type
depends on the platform too.
4 - However, there is a key difference among FPC 3 and the previous
versions: in the FPC 3, the compiler do perform automatic conversions in
certain circumstances (two ansistring variables with diferent codepages). I
think these automatic conversions can potentially be the source of
unexpected data corruption.
5 - The automatic conversion is a desirable feature. IMHO, the definitive
solution would be to stop the unpredictable dynamic behavior of the String
type following the same path that Delphi followed: addopt the same unicode
string code page on all platforms.
6 - A workaround when developing a cross-platform app is to use the Lazarus
Unicode Support
<http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus>;
Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160511/3f193a79/attachment.html>
More information about the fpc-pascal
mailing list