-1

I'm trying to print simple cyrillic string to console using IBM Java, but instead of correct string there is trash. Latin string prints correctly. What have i do to fix that?

I'm using IBM J9 VM (build 2.9, JRE 1.8.0 Windows 10 amd64-64 Compressed References 20180425_385365 (JIT enabled, AOT enabled)

    public static void main(String[] args)  {

        String text = "Простой текст";
        System.out.println(text);
    }
}

Source string: "Простой текст" Result: ���⮩ ⥪��

Also if i'm using Oracle JDC, it works correctly. My source code files are encoded in UTF-8, and console works in UTF-8. Also, I've tryed to run code from Unable to print russian characters and get no changes.

Oleg
  • 49
  • 10

1 Answers1

0

The problem was in IBM JDK: it's convert wrong cyrillic symbols in java class from cp1251 to UTF-8, so I convert my source code to UTF-8 and rewrite text - that's solve the problem.

Oleg
  • 49
  • 10