Skip to content

Commit 9a9eee1

Browse files
authored
Fixes #569
1 parent df75783 commit 9a9eee1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/danfojs-base/io/browser/io.csv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const $toCSV = (df: NDframe | DataFrame | Series, options?: CsvOutputOptionsBrow
160160
*/
161161
const $downloadFileInBrowser = (content: any, fileName: string) => {
162162
var hiddenElement = document.createElement('a');
163-
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(content);
163+
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(content);
164164
hiddenElement.target = '_blank';
165165
hiddenElement.download = fileName;
166166
hiddenElement.click();

src/danfojs-base/io/browser/io.json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const $toJSON = (df: NDframe | DataFrame | Series, options?: JsonOutputOptionsBr
174174
*/
175175
const $downloadFileInBrowser = (content: any, fileName: string) => {
176176
var hiddenElement = document.createElement('a');
177-
hiddenElement.href = 'data:text/json;charset=utf-8,' + encodeURI(JSON.stringify(content));
177+
hiddenElement.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(content));
178178
hiddenElement.target = '_blank';
179179
hiddenElement.download = fileName;
180180
hiddenElement.click();

0 commit comments

Comments
 (0)