How to add UTF-8 for non english support in JavaFX?


Question

I want to add UTF-8 Farsi characters in JavaFX but when I add a label with Persian content it shows some weird results.

Do I have to use a specific plugin or configuration to handle this issue?

1
9
7/10/2018 10:16:05 AM

Persian is right to left?

In which case you want to use a version of JavaFX with RTL support. That would be JavaFX 8 (included in JDK8). There is a preview available here.

Make sure you have loaded and are using a font which includes the glyphs for Persian characters.

Here is some sample JavaFX 8 code for displaying something which looks to me like Persian script.

All other comments on this question regarding using and interpreting the correct character encoding are also valid.

5
12/31/2012 5:45:17 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon