I am reading some info from a database in MySQL and I need to write them in an excel file
XSSFWorkbook workbook =new XSSFWorkbook();
...
cell.setCellValue(addressValue); // suppose addressValue is what I have obtained from mysql
....
try (FileOutputStream outputStream = new FileOutputStream(myfile)) {
workbook.write(outputStream);
}
In MySQL, the table charset is UTF8, and the field is considered utf8_general_ci.
But this way, it does not handle special characters. for example I see something like "名古屋市" while it should be "名古屋市".
Or
"Москва" which should be "Москва".
Or
"St. Honoré" which should be "St. Honoré".