关于jxl的getCellFormat()方法获取表格样式----中文货币乱码

File templateFile = getTempalte(client.getSc_shortName());//这里读取模板文件                        
 WorkbookSettings set1 = new WorkbookSettings();//读取时的编码规范
 set1.setEncoding("iso-8859-1");
 WorkbookSettings set2 = new WorkbookSettings();//创建写入格式时的编码规范
 set2.setEncoding("utf-8");
 Workbook in = jxl.Workbook.getWorkbook(templateFile,set1);
 WritableWorkbook     wbook = jxl.Workbook.createWorkbook(reportfile,in, set2);

之前并没有做过编码控制,汉字也不会出现问题,唯独某些特殊符号会出乱子!

posted @ 2017-07-27 09:40  天涯已可  阅读(1898)  评论(0编辑  收藏  举报