[fpc-pascal] Unicode chars losing information

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Tue Mar 9 00:55:59 CET 2021

On 07/03/2021 5:48 pm, Nikolay Nikolov via fpc-pascal wrote:
> It depends on what you mean by "just working".

No, "just worked" is exactly what it says on the tin. It is FPC that
overcomplicating matters.

As an example, here is Java that also uses UTF-16 encoding, just like
FPC's UnicodeString type.

$ cat UnicodeTest.java
class UnicodeTest {

    public static void main(String[] args) {
        String s = "⌘⌥⌫⇧^";

Now lets compile and run that.

$> javac UnicodeTest.java
$> java UnicodeTest
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on

Yes, it just worked.

And contrary to what Marco was trying to imply, the "Place of Interest"
(aka MacOS CMD symbol) is within the BMP, thus only takes up 2 bytes
encoded as UTF-16, and should be able to be represented in FPC's
Unicode Char type.


More information about the fpc-pascal mailing list