I am creating a string in my spring controller, it contain turkish characters
String str1 = "iş ortaklığı";
If i try to print it like System.setOut(new PrintStream(System.out,true,"UTF-8")); System.out.println(s);
output is iş ortaklığı
byte[] utf81 = str1.getBytes("UTF-8"); test3 = new String(utf8);
System.out.println(test3);
output is iş ortaklığı
byte[] utf8 = str1.getBytes("windows-1254"); test3 = new String("windows-1254");
output is iþ ortaklýðý
But All the above code works fine in console program that is main method
main method prints output like
iş ortaklığı
Any suggetion must appriciable