I have a table with UTF8 charset. The columns are considered utf8_general_ci. I am reading the data using prepared statement but they are not shown correctly. The data inside the table is not readable too. I need to write a code in a way that they are human readable. I have tested many methods which all failed. For the Connection property I used "?useUnicode=true&characterEncoding=UTF8";
String city=resultset.getString("city");
byte[] data = city.getBytes();
String valueCity = new String(data, "UTF-8"); // Or String valueCity = new String(data, StandardCharsets.UTF_8);
I see something like "名 ; & #21476 ;& #23627; & #24066;" in my table but I need to read or write them like 名古屋市. Any suggestions that I may handle this problem which is a pain on my neck? thanks a million in advance