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
12