Open lishengzxc opened 7 years ago
http://blog.csdn.net/leonzhouwei/article/details/8447643
原因是 Excel 以 ANSI 格式打开,不会做编码识别。
function downloadCSV(fileName, content) { let a = document.createElement('a'); let file = URL.createObjectURL((new Blob(['\uFEFF' + content], { type: 'text/csv;charset=utf-8' }))); a.href = file; a.download = `${fileName}.csv`; a.click(); }
http://stackoverflow.com/questions/19492846/javascript-to-csv-export-encoding-issue
http://blog.csdn.net/leonzhouwei/article/details/8447643
解决方法
http://stackoverflow.com/questions/19492846/javascript-to-csv-export-encoding-issue