[fpc-pascal] Printing unicode characters

Adriaan van Os adriaan at adriaan.biz
Sun Dec 1 08:02:06 CET 2024


Hairy Pixels via fpc-pascal wrote:
> ChatGPT is saying I can  print unicode scalars like that but i don’t see 
> it works and no compiler warnings even. Did it make this up or did I do 
> something wrong?
> 
>   Writeln('Unicode scalar 1F496: ', #$1F496); // 💖
>   Writeln('Unicode scalar 1F496: ', WideChar($1F496));  // 💖

What people call "Unicode", even compiler manuals, is not "Unicode". I repeat it again and again, 
it is not "Unicode" but so-called "Unicode". Microsoft, and those who want to be compatible with 
it, use UTF-16 <https://en.wikipedia.org/wiki/UTF-16> treated as if it were UCS-2 
<https://en.wikipedia.org/wiki/Universal_Coded_Character_Set>

They call that "Unicode", which is plain nonsense. In the real world, one can not stuff 21-bits 
into 16-bits.

For heaven's sake, let's stop talking about so-called "Unicode" and instead use UTF-8 
<https://en.wikipedia.org/wiki/UTf-8> or UTF-32 <https://en.wikipedia.org/wiki/UCS-4>.

Regards,

Adriaan van Os



More information about the fpc-pascal mailing list