Anybody knows why UnicodeChar differs from wchar_t ? (or similar in any other unicode supporting language!)
Currently it is just UCS2 size. It really should be size 4.
So OK on Delphi it is also size 2, I guess.
I suspect that a size 4 greatly simplifies handling codepoints.
Because Delphi defines
UnicodeChar to be used with UTF-16 which has 2 Byte codepoints and Delphi in turn uses UTF-16, because Windows uses UTF-16. For UTF-32 there is
UCS4Char (though this is not a true, builtin character type, but simply an alias to
LongWord).
Not only on Delphi, but windows itself.
is 2 at windows, 32 or 64 bit, gcc or cl.
So fpc loves windows.
No, for FPC Delphi-compatibility is the main driver and thus
UnicodeChar is declared the same as it is in Delphi which - as written above - uses UTF-16 (and thus 2 Byte codepoints), because Windows uses UTF-16.