Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing unicode strings in Intellij Idea debugger

How to view Unicode encoded strings in Intellij Idea debugger data view? e.g. consider following code

String str = "सुझाव"; //some Unicode string: utf-8
String str1 = "\u0938\u0941\u091d\u093e\u0935";
System.out.println(str);

Not able to view the variable- str - in data view of debugger, it shows garbage value. Even though set value shows proper value.

enter image description here Any suggestions/work-arounds?

Probably, missing some encoding setting somewhere.

like image 470
Amit G Avatar asked Aug 28 '13 06:08

Amit G


1 Answers

Check project encoding. I have same issue. Idea shows variables content encoding in WIN-1252. In version in Editor > File Encodigs you have: IDE Encoding, and Project Encoding. After changing Project Encoding to UTF-8 everything looks ok.

like image 63
Styx Avatar answered Oct 03 '22 04:10

Styx