Javascript to csv export encoding issue

前端 未结 8 1387
Happy的楠姐
Happy的楠姐 2020-11-29 00:33

I need to export javascript array to excel file and download it I\'m doing it in this code. data is a javascript object array.

var csvContent = \"data:t         


        
8条回答
  •  日久生厌
    2020-11-29 01:27

    You can add the BOM at first, use this code and try

    var BOM = "\uFEFF"; 
    var csvContent = BOM + csvContent;
    

    and then crate the file headers with the data: "text/csv;charset=utf-8"

提交回复
热议问题