Problem when running project - Special characters

2

Good afternoon, I migrated my project to Intellij IDEA and when I run a code that should print a string with accentuation, I have the return: "method". The classes display the accent correctly more when calling on the console they bugam. I've attached some images from the system:  

This is the return of the IDE console.

Any suggestions? Thank you in advance.

    
asked by anonymous 28.07.2016 / 21:35

2 answers

1

First check that your files are actually encoded in ISO-8859-1 , if so, your console may be set to UTF-8 or some other type of encoding.

You can change the console encoding by adding the -Dconsole.encoding flag to idea.vmoptions and idea64.vmoptions files within [diretório de instalação do IDEA]\bin .

For example, on my Windows machine with the 2016.2 version of IntelliJ IDEA installed in the default directory these files are in:

C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2\bin\idea.exe.vmoptions
C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2\bin\idea64.exe.vmoptions

Edit these files and add the line -Dconsole.encoding=ISO-8859-1 , eg.:

-server
-Xms128m
-Xmx512m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Dconsole.encoding=ISO-8859-1
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

Reference : SOen - Intellij Idea incorrect encoding in console output

    
28.07.2016 / 23:27
0

Right click on your project package. Go to properties then find the encoding and select ISO-8859-1 which is to synchronize the encoding of the text.

Font

    
28.07.2016 / 23:22