Java JExcel编码为Utf-8
我们有一个旧的应用程序在这里写从其他文件读取的xls文件。 我面临的问题是,编码不会被转移到新创build的.xls,它会跳过所有特殊字符(ÅÄÖ,IM斯堪的纳维亚语)。
我试图设置新的工作簿Utf-8没有成功,请参阅下面的代码:
File f = new File(pathName + fileName + ".csv"); System.out.println(splitName[1]); if(f.exists()) f.delete(); OutputStream os = (OutputStream) new FileOutputStream(f); OutputStreamWriter osw = new OutputStreamWriter(os, "Utf-8"); BufferedWriter bw = new BufferedWriter(osw); WorkbookSettings ws = new WorkbookSettings(); ws.setLocale(new Locale("en", "EN")); ws.setEncoding("Utf-8"); Workbook w = Workbook.getWorkbook(new File(pathName + fileName + ".xls"), ws);
我错过了什么?