[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 = "⌘⌥⌫⇧^";
System.out.println(s);
System.out.println(s.charAt(0));
System.out.println(String.format("%x",s.codePointAt(0)));
}
}
====================================
Now lets compile and run that.
$> javac UnicodeTest.java
$> java UnicodeTest
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
⌘⌥⌫⇧^
⌘
2318
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.
Regards,
Graeme
More information about the fpc-pascal
mailing list