B4stien, thank you to you for your answer!
After testing several solutions based on charset "utf8", encoding windows-1252 is the only solution that allowed me to keep my accent in Excel 365!
Manetsus, the b4stien's answer and his link were very usefull for my case: i have to export french and german data into csv file: no solution based on "utf8" has worked... Only his solution which use an "ANSI" (window-1252) encoder...
I give his code sample, and you can download the depending encoding-indexes.js, encoding.js and FileSaver.js from the link...
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="encoding-indexes.js"></script>
<script type="text/javascript" src="encoding.js"></script>
<script type="text/javascript" src="FileSaver.js"></script>
</head>
<body>
<a href="#" id="download-csv">Click me to download a valid CSV !</a>
<script type="text/javascript">
var csvContent = 'éà; ça; 12\nà@€; çï; 13',
textEncoder = new CustomTextEncoder('windows-1252', {NONSTANDARD_allowLegacyEncoding: true}),
fileName = 'some-data.csv';
var a = document.getElementById('download-csv');
a.addEventListener('click', function(e) {
var csvContentEncoded = textEncoder.encode([csvContent]);
var blob = new Blob([csvContentEncoded], {type: 'text/csv;charset=windows-1252;'});
saveAs(blob, fileName);
e.preventDefault();
});
</script>
</body>
</html>
Nevertheless, as Excel is relatively open in the support of languages and formats, I do not exclude that UTF8 is not supported in my development environment because of the way it is installed ...
Note: I test it with Firefox, Chrome and IE 11 on windows 7, with Excel 365...