Skip to content

Commit 4f07682

Browse files
author
rofl256
committed
add support for special characters in questions
1 parent 83416bd commit 4f07682

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

web/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ function saveQuestions() {
336336
objToSave.push(oneQ);
337337
});
338338
var jsonQues = JSON.stringify(objToSave);
339-
jsonQues = btoa(jsonQues);
339+
jsonQues = btoa(encodeURIComponent(jsonQues));
340340
wsSend("fileOp","write###fragen.txt###"+jsonQues);
341341
}
342342

web/js/websocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var connectWs = function() {
115115
} else if(key == "file") {
116116
if(value == "fragen.txt") {
117117
try {
118-
var base64 = atob(messageParts_a[2]);
118+
var base64 = decodeURIComponent(atob(messageParts_a[2]));
119119
fragen = JSON.parse(base64);
120120
fillFragenEditor();
121121
fillFragenSelect();

0 commit comments

Comments
 (0)