From 7611b07c2c60261fc594d3b8f22162279e30c7b9 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sun, 22 Jan 2023 11:28:13 +0100 Subject: fix utf8 encoding of custom parameters --- server/templates/server/doc_create.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/templates') diff --git a/server/templates/server/doc_create.html b/server/templates/server/doc_create.html index 908d1eb..6ba708c 100644 --- a/server/templates/server/doc_create.html +++ b/server/templates/server/doc_create.html @@ -200,7 +200,8 @@ $(document).ready(function(){ function preview() { var param = document.getElementById("param").value; - var param_base64 = btoa(param); + let utf8Encode = new TextEncoder(); + var param_base64 = btoa(String.fromCharCode.apply(null, new Uint8Array(utf8Encode.encode(param)))); window.open("{%url 'custom_parameters_preview' %}?param=" + param_base64); } {% endblock %} \ No newline at end of file -- cgit v1.2.1