1

I've been working on an assignment in java but when i try to write any Amharic characters they turn into boxes

for example, when I try to print this Amharic character (አማርኛ) on IntelliJ or net beans it shows it as little boxes

if anyone is familiar with this please take a look, thanks in advance.

Shailesh Chandra
  • 2,164
  • 2
  • 17
  • 25
m.prime
  • 67
  • 7

2 Answers2

0

I'm assuming you are referring to the output console in IntelliJ. Default the console encoding is UTF-8. You can edit this setting.

Go to help >> edit custom vm options and add (first click "create" if it's your first time there): "-Dconsole.encoding=UTF-8" (but replace UTF-8 with the one you need)

Google for "console encoding" + name of your editor if you want more information. Good luck! :)

Maria
  • 31
  • 4
  • Incorrect character encoding will usually get you `?` question marks, not boxes. Boxes is what fonts use to display characters that are not in the font, so OP is likely having font issues, not character set issues. – Andreas Nov 03 '19 at 21:18
  • i actually was working on a java fx project and i cant print these characters on the console nor can i set them on buttons or labels, how do you think i can fix this? – m.prime Nov 03 '19 at 21:26
  • @m.prime As Andreas has commented, your issue is at least partly the font. If you're using JavaFX then use a [`javafx.scene.text.Font`](https://openjfx.io/javadoc/13/javafx.graphics/javafx/scene/text/Font.html) capable of displaying the needed characters. – Slaw Nov 03 '19 at 22:07
0

You a need a font that supoorts Amharic.

I am using Abyssinica SIL as an example below and NetBeans IDE

Editor

  • unpack the zip file a and install the font by running "AbyssinicaSIL-Regular.ttf" file
  • In Netbeans IDE select Tools > Options and click the Fonts & Colors icon
  • On the Syntax tab click the braces (...) on the right of the Font field and choose the Abyssinica SIL font you just installed, and click OK.
  • Amharic text should now be correctly desplyed in the editor window but not in the output window. For the output follow below steps

Output

  • In NetBeans Ouput window right click and select Settings... , click the Miscellaneous icon, and then click the Output tab
  • Click the Import... button
  • Click the Browse... button and choose the Zip file you downloaded above.(AbyssinicaSIL-2.000.zip)
  • click OK to close the Select Options to import window you'll get a warning "Import may irreversibly overwrite your current settings..." You can trust me on this and ignore the warning and click Yes to continue and restart NetBeans.
  • After the restart: right click on the Ouput window and select Settings... > Miscellaneous > Output Click on the (...) button to the right of the Font field and choose the Abyssinica SIL font and click OK. Amharic text will now render correctly in the Output window.

ይህ መልስ ጠቃሚ ነበር ብዬ ተስፋ አደርጋለሁ ፡፡ መልካም ምሽት እመኛለሁ ፡፡

Eritrean
  • 15,851
  • 3
  • 22
  • 28
  • sorry but the font isn't showing up on netbeans settings the font is installed and it shows up on apps like Microsoft word but not on netbeans, what should i do? – m.prime Nov 04 '19 at 09:12