Skip to content

Commit

Permalink
Fixes #569
Browse files Browse the repository at this point in the history
  • Loading branch information
acctsi1 authored Apr 27, 2023
1 parent df75783 commit 9a9eee1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/danfojs-base/io/browser/io.csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const $toCSV = (df: NDframe | DataFrame | Series, options?: CsvOutputOptionsBrow
*/
const $downloadFileInBrowser = (content: any, fileName: string) => {
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(content);
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(content);
hiddenElement.target = '_blank';
hiddenElement.download = fileName;
hiddenElement.click();
Expand Down
2 changes: 1 addition & 1 deletion src/danfojs-base/io/browser/io.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const $toJSON = (df: NDframe | DataFrame | Series, options?: JsonOutputOptionsBr
*/
const $downloadFileInBrowser = (content: any, fileName: string) => {
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:text/json;charset=utf-8,' + encodeURI(JSON.stringify(content));
hiddenElement.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(content));
hiddenElement.target = '_blank';
hiddenElement.download = fileName;
hiddenElement.click();
Expand Down

0 comments on commit 9a9eee1

Please sign in to comment.