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();
}
utf8 csv files need to have BOM header
Reference link http://blog.csdn.net/youzhoul...
Changing UTF-8 to GBK should eliminate garbled characters. CSV is a bit tricky