Problem running project - Special characters

Asked

Viewed 1,011 times

2

Good afternoon, I migrated my project to Intellij IDEA and when executing a code that should print an accentuated string, I got the return: "m? all" (method). Classes display the accent correctly more when calling on the console they hold. I have attached some system images: Encoding configuração

Minha classe que possui as strings com acentuação

Resultado

This is the return of the IDE console.

Any suggestions? Grateful from now on.

2 answers

1

First check if your files are really backed up in ISO-8859-1, if yes, it may be that your console is set to UTF-8 or some other type of coding.

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

For example, on my Windows machine with version 2016.2 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, e. g.:

-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

0

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

Source

Browser other questions tagged

You are not signed in. Login or sign up in order to post.