I was playing around with Swing, and faced following problem with text encoding with JButton class
So would be grateful for explanation or some links explaining why this code display broken text - 'Р'РёР±СЂР°С, Рё':
JButton selectButton = new JButton("Вибрати");
but when I explicitly specify encoding everything works fine:
JButton selectButton = new JButton(new String("Вибрати".getBytes(), StandardCharsets.UTF_8));
File with code has UTF-8 encoding
javac -encoding UTF-8 Sanbox.java
would probably make a difference-encoding
option as commented by g00se (actually I would change the settings of windows to support UTF-8)