Skip to content

Commit

Permalink
Merge pull request #570 from acctsi1/patch-1
Browse files Browse the repository at this point in the history
Fixes #569
  • Loading branch information
steveoni authored Aug 7, 2023
2 parents c8e263d + 9a9eee1 commit 7638681
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 @@ -163,7 +163,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 7638681

Please sign in to comment.