21

My laptop suffered a hard drive failure and i had to re-install IntelliJ and windows on a new hard drive. In my old drive i was able to print (system.out.println) foreign languages in the console without any issues, but after the re-installation my console is not recognizing the text and i get an output like this

????????????? ???? |
??????????-??? ??_???????-???

?????? ???????:
?????: ?????????-?????
????????? ??-?? ? 1-1 ?

i dont think its due to any error in my source, is there any way to configure my IDE to be able to recognize this text ( tamil in this instance but i need to support a large number of languages )

Thanks in advance, Sumal.

Galya
  • 6,294
  • 6
  • 27
  • 45
Sumal Perera
  • 297
  • 1
  • 3
  • 6
  • Similar: https://stackoverflow.com/questions/35231291/intellij-idea-incorrect-encoding-in-console-output – Vadzim Nov 28 '17 at 09:23

4 Answers4

39

The proposed solution wasn't working for me. Even though I've set the IDE encoding & Project encoding to UTF-8 in Idea's Settings, the console continued to not display properly the characters. So for other people in the same situation I'm going to post another solution which worked for me.

You need to find the idea executable file. On Windows it's probably under "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.5\bin". In the file "idea.exe.vmoptions" you need to add the following line:

-Dfile.encoding=UTF-8
Galya
  • 6,294
  • 6
  • 27
  • 45
  • Works in Android Studio 1.5.1, Windows 10. – dnp Mar 31 '16 at 11:50
  • 14
    Worked via Help -> Edit Custom VM Options – Pat May 31 '17 at 16:09
  • Thanx it works for me at `IntelliJ IDEA 2019.3.4 (Ultimate Edition) Build #IU-193.6911.18, built` `on March 17, 2020 Runtime version: 11.0.6+8-b520.43 amd64 VM: OpenJDK` `64-Bit Server VM by JetBrains s.r.o Windows 10 10.0`. 1. Open `ABOUT` 2. Click `Edith Custom VM Options...` 3. Set String `-Dfile.encoding=UTF-8` 4. Restart IDEA – Partizanin Apr 01 '20 at 10:43
8

In Help / Edit Custom VM Options... add:

-Dconsole.encoding=UTF-8
-Dfile.encoding=UTF-8

...and restart IDE :)


You can also edit file manualy from:

  • C:\Program Files\JetBrains\IntelliJ IDEA\bin\idea64.exe.vmoptions

or

  • C:\Users\[YOUR_USER_NAME]\AppData\Roaming\JetBrains\IntelliJIdea2021.2\idea64.exe.vmoptions

depending on what config file uses your IDE.


If you are using x86 version the file is named accordingly

createdbyjurand
  • 1,177
  • 1
  • 6
  • 6
4

Check if you have selected an IDE encoding that supports foreign languages.

Settings → File Encoding → Project Encoding → IDE Encoding

There, select UTF-8.

sina72
  • 4,931
  • 3
  • 35
  • 36
1

For x64 version of the Executable, you have to find the file idea64.exe.vmoptions instead, and add the line -Dfile.encoding=UTF-8 as others mentioned.

code đờ
  • 554
  • 1
  • 9
  • 19