I'm trying to process some data with apache POI. I'm generating a word file, but since I'm german, I'm using Umlaute (ä,ö,ü), which aren't displayed correctly in the generated word file. I think, a word file doesn't have an encoding set by default, but I'm not quite sure.
Is there a way to set an encoding style to the XWPFDocument object?
Help would be appreciated! Thank you very much!
Edit:
Sample code:
XWPFDocument doc = new XWPFDocument();
XWPFTable table = doc.createTable();
XWPFTableRow row = table.getRow(0);
XWPFTableCell cell = row.getCell(0);
cell.setText("äüöß");
FileOutputStream fos = new FileOutputStream(new File("OutputFile.docx"));
doc.write(fos);
doc.close();
Output is as follows:
https://i.stack.imgur.com/pLEOd.png
System.getProperty("file.encoding");
returns windows-1252
. Setting the Property to UTF-8
didn't help.