[fpc-pascal] Unicode chars losing information

Marco van de Voort fpc at pascalprogramming.org
Sun Mar 7 17:31:22 CET 2021


Op 2021-03-07 om 17:21 schreef Ryan Joseph via fpc-pascal:
> I came across a bug which was caused but a unicode character losing information and narrowed it down to this. Why doesn't the chars[1] print the same character as appeared in the string?
>
> var
>    chars: UnicodeString;
> begin
>    chars := '⌘⌥⌫⇧^';
>    writeln(chars);
>    writeln(chars[1]);
> end.
>
> Prints:
>
> ⌘⌥⌫⇧^
> ?

Probably it is not in the BMP and thus needs more position than one.



More information about the fpc-pascal mailing list