mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix bug
This commit is contained in:
parent
449ec53da2
commit
7fad8f6f7c
@ -373,7 +373,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
||||
}
|
||||
|
||||
fileName = StrUtil.addSuffixIfNot(URLUtil.encodeAll(fileName, charset), isXlsx() ? ".xlsx" : ".xls");
|
||||
return StrUtil.format("attachment; filename=\"{}\";", fileName);
|
||||
return StrUtil.format("attachment; filename=\"{}\"", fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.poi.excel.cell.setters.EscapeStrCellSetter;
|
||||
@ -22,6 +23,7 @@ import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -879,6 +881,8 @@ public class ExcelWriteTest {
|
||||
|
||||
@Test
|
||||
public void getDispositionTest(){
|
||||
|
||||
ExcelWriter writer = ExcelUtil.getWriter(true);
|
||||
final String disposition = writer.getDisposition("测试A12.xlsx", CharsetUtil.CHARSET_UTF_8);
|
||||
Assert.assertEquals("attachment; filename=\"%E6%B5%8B%E8%AF%95A12.xlsx\"", disposition);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user