I have the following text:
Анна Меркулова
With help of the following online decoder https://2cyr.com/decode/?lang=en I was able to decode mentioned string to the correct one:
Анна Меркулова
Source encoding is UTF-8 and the target is WINDOWS-1251
but I still unable to do it programmatically in Java:
String utf8String = new String("Анна Меркулова".getBytes(), "UTF-8");
String ansiString = new String(utf8String.getBytes("UTF-8"), "windows-1251");
System.out.println(ansiString);
returns
Анна Меркулова
What am I doing wrong and how to properly convert the string?