Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

deleted 1 character in body
Source Link
Can Bozdemir
  • 453
  • 1
  • 5
  • 8

I need to export javascript array to CSV file and download it. I did it but 'ı,ü,üö,ğ,ş' this charachterscharacters looks like 'ı Ã1⁄4 Ã1⁄4 ğö ÄŸ ÅŸ' in the CSV file. I have tried many solutions recommended on this site but didn't work for me.

I added my code snippet, Can anyone solve this problem?

var csvString = 'ı,ü,üö,ğ,ş';
var a = window.document.createElement('a');
a.setAttribute('href', 'data:text/csv; charset=utf-8,' + encodeURIComponent(csvString));
a.setAttribute('download', 'example.csv');
a.click();

I need to export javascript array to CSV file and download it. I did it but 'ı,ü,ü,ğ,ş' this charachters looks like 'ı Ã1⁄4 Ã1⁄4 ÄŸ ÅŸ' in the CSV file. I have tried many solutions recommended on this site but didn't work for me.

I added my code snippet, Can anyone solve this problem?

var csvString = 'ı,ü,ü,ğ,ş';
var a = window.document.createElement('a');
a.setAttribute('href', 'data:text/csv; charset=utf-8,' + encodeURIComponent(csvString));
a.setAttribute('download', 'example.csv');
a.click();

I need to export javascript array to CSV file and download it. I did it but 'ı,ü,ö,ğ,ş' this characters looks like 'ı Ã1⁄4 ö ÄŸ ÅŸ' in the CSV file. I have tried many solutions recommended on this site but didn't work for me.

I added my code snippet, Can anyone solve this problem?

var csvString = 'ı,ü,ö,ğ,ş';
var a = window.document.createElement('a');
a.setAttribute('href', 'data:text/csv; charset=utf-8,' + encodeURIComponent(csvString));
a.setAttribute('download', 'example.csv');
a.click();

Source Link
Can Bozdemir
  • 453
  • 1
  • 5
  • 8

Javascript export CSV encoding utf-8 issue

I need to export javascript array to CSV file and download it. I did it but 'ı,ü,ü,ğ,ş' this charachters looks like 'ı Ã1⁄4 Ã1⁄4 ÄŸ ÅŸ' in the CSV file. I have tried many solutions recommended on this site but didn't work for me.

I added my code snippet, Can anyone solve this problem?

var csvString = 'ı,ü,ü,ğ,ş';
var a = window.document.createElement('a');
a.setAttribute('href', 'data:text/csv; charset=utf-8,' + encodeURIComponent(csvString));
a.setAttribute('download', 'example.csv');
a.click();

lang-js

AltStyle によって変換されたページ (->オリジナル) /