java Export csv file with garbled characters through header
try{
context.response().putHeader("Content-type", "text/csv; charset=UTF-8")
.putHeader("Content-Disposition", "attachment;filename="+csv_name+".csv;charset=utf-8")
.putHeader("write","\ufeff")
.end(string);
}catch (Exception e){
e.printStackTrace();
}
天蓬老师2017-05-17 10:00:38
utf8 csv files need to have BOM header
Reference link http://blog.csdn.net/youzhoul...
迷茫2017-05-17 10:00:38
Changing UTF-8 to GBK should eliminate garbled characters. CSV is a bit tricky