[fpc-announce] Feature announcement: Unicode character constants outside of BMP
pascaldragon at googlemail.com
Sun May 27 16:12:28 CEST 2018
Small feature announcement this time, but some might like it nevertheless:
FPC now supports unicode character constants that are outside of the
Basic Multilingual Plane (BMP), thus all with a value > $FFFF, but <
$10FFFF (the highest possible Unicode code point). As these are encoded
as surrogate pairs in UTF-16 they aren't a single UnicodeChar, but
instead they are always a UnicodeString constant.
All four bases that FPC supports for specifying character constants are
covered: binary (#%…), octal (#&…), decimal (#…) and hexadecimal (#$…).
This is also Delphi compatible.
Example (based on the code points provided in here:
=== code begin ===
procedure DumpStr(const aStr: UnicodeString);
for u in aStr do
Write(HexStr(Ord(u), 4), ' ');
s := #$10437;
s := #$24b62;
=== code end ===
This will result in the following output:
=== output begin ===
=== output end ===
More information about the fpc-announce