Skip to content

Commit e5dc3f8

Browse files
committed
[code sandbox] Don't use base64 in data url
Since apparently btoa throws on non-ascii input
1 parent 5baf434 commit e5dc3f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html/js/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ addEventListener("load", function() {
140140
type: exercise.type};
141141
setEditorCode(exercise.code, exercise.type);
142142
visible = "exercise";
143-
document.querySelector("#download").href = "data:text/plain;base64," + btoa(exercise.solution);
143+
document.querySelector("#download").href = "data:text/plain;charset=UTF-8," + exercise.solution;
144144
}
145145
["box", "exercise"].forEach(function(id) {
146146
document.querySelector("#" + id + "_info").style.display =

0 commit comments

Comments
 (0)