Cyrillic symbols in console on mac

Hi!

Recently I ran into problem -
I am writing application that uses Postgres, and for debugging purposes I tried to print some info from DB to console.
All cyrillic symbols appeared as ?????...But on actual web pages information displayed properly. Then I tiied to do something like

        System.out.println("бе-бе-бе");

Result is same - all cyrillic symbols became ????????

Does anyone know how to solve this?


5 comments
Comment actions Permalink

Hi.

Output from DB and java application are different things. For java app check encoding of your source file and also options Settings / File encodings / IDE encoding, Settings / File encodings / Project default encoding. If file encoding is the same as project encoding, then compiler should produce correct .class files and the output in console should be Ok.

Output in JDBC console is mostly taken from the database. Do you mean that Result table contains "?????" in its cells? What debug query do you execute?

Alexander.

0
Comment actions Permalink

Now I see the same issue that Alexey did.
I have java source files in the UTF-8. I run my unit test with  -Dfile.encoding=UTF-8  VM parameter and I see corrupter character instead of Russian letter.

I feel that console encoding has to be set somewhere, but I don't see any settings about this.

0
Comment actions Permalink

I've found a solution.
The point is that run/debug console uses the IDEA encoding. IDEA is a java application and encoding can be set in the idea.exe.vmoptions file as ordinary VM parameter. This file lies near your IDEA executabe file and conteins a set of JVM parameters. Add -Dfile.encoding=UTF-8 there to set encoding in UTF-8.

An application or a junit test has to be run with the same encoding as IDEA does. Encoding for the application can be set in "Run/Debug Configuration" window in the "VM parametrs:" "-Dfile.encoding=UTF-8" string makes UTF-8 default encoding for the app.

0
Comment actions Permalink

Hello.

IDEA should take encodings specified in Settings / File Encoding. First, it should take project one, if project encoding is not set then it should take IDE encoding.

Alexander.

0
Comment actions Permalink

It might be, but it doesn't work this :)

Project encoding (source files encoding) doesn't influence to the default encoding that started applications have. Also it isn’t connected to the encoding of console. Try set default encoding for IDEA itself, it helped me.



My IDEA is 8.01

0

Please sign in to leave a comment.