I have a relatively "common" problem. I have a Java program that makes importing an Excel spreadsheet and one of the column fields has words with accents, cedillas, etc.
At the time of reading the variable, you are always marking with a black diamond in these special characters.
I already tried some solutions with normalizer
, getBytes()
with all possible encodings and tried to use something like this:
WorkbookSettings ws = new WorkbookSettings();
ws.setEncoding("Cp1252");
But nothing solved: (
The main code (to understand the problem) is:
Workbook workbook = Workbook.getWorkbook(new File(diretorio,v_arquivo));
Sheet sheet = workbook.getSheet(0);
Cell[] celula;
for (int i = 1; i < sheet.getRows(); i++){
celula = sheet.getRow(i);
if (celula.length > 0){
evento = celula[7].getContents().trim();
}
}
And my Event String appears as for example lactation Thank you for your attention.
ps: I'm new to the forum, I'm still learning the formatting, sorry for the possible errors.