Skip to content

Commit

Permalink
added fixes for special char csv extract
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltangbcgov committed Dec 13, 2023
1 parent 4aee412 commit 9aac88f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/stores/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const useAppStore = defineStore('app', {
},
exportCSV(csvData: any) {
// Create a blob with the CSV data
const blob = new Blob([csvData], { type: 'text/csv' });
const utf8EncodedData = new TextEncoder().encode('\uFEFF' +csvData);
const blob = new Blob([utf8EncodedData], { type: 'text/csv;charset=utf-8' });
// Create a temporary anchor element to trigger the file download
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
Expand Down

0 comments on commit 9aac88f

Please sign in to comment.