I want to export my datatable to CSV. How to specify utf-8 encoding?
http://jsfiddle.net/ebRXw/3058/
Mamadou Diôf become Mamadou Diôf after the export
I've tryied to add "bom":true
but still the problem
Put bom in csv extend option:
$(document).ready(function() {
var dataSet = [
[ "Tiger Nixon", "System Architect", "Edinburgh", "5421", "2011/04/25", "$320,800" ],
[ "Garrett Winters", "Accountant", "Tokyo", "8422", "2011/07/25", "$170,750" ],
[ "Mamadou Diôf", "Junior Technical Author", "San Francisco", "1562", "2009/01/12", "$86,000" ]
];
$('#example').DataTable( {
dom: 'Bfrtip',
data: dataSet,
columns: [
{ title: "Name" },
{ title: "Position" },
{ title: "Office" },
{ title: "Extn." },
{ title: "Start date" },
{ title: "Salary" }
],
buttons: [
{
extend: 'csv',
charset: 'UTF-8',
fieldSeparator: ';',
bom: true,
filename: 'CsvTest',
title: 'CsvTest'
}
]
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With