Re: Printing unicode characters
Adriaan van Os via fpc-pascal <[email protected]>
| Newsgroups | gmane.comp.compilers.free-pascal.general |
|---|---|
| Message-ID | <[email protected]> |
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
_______________________________________________
fpc-pascal maillist - [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal