From 5413e8d8b72567e8dcc4638bfb83ef32925470ee Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 11 Nov 2014 14:28:07 +0100 Subject: [PATCH] btoa takes bytes not unicde string, encode utf8 data first --- static/js/exportAnnotationsDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/exportAnnotationsDialog.js b/static/js/exportAnnotationsDialog.js index b75f583f..01e861ab 100644 --- a/static/js/exportAnnotationsDialog.js +++ b/static/js/exportAnnotationsDialog.js @@ -124,11 +124,11 @@ pandora.ui.exportAnnotationsDialog = function(options) { $link.attr({ download: options.title + ' - ' + Ox.getObjectById(layers, layer).title + '.' + format, - href: 'data:text/plain;base64,' + btoa( + href: 'data:text/plain;base64,' + btoa(Ox.encodeUTF8( format == 'json' ? JSON.stringify(items, null, ' ') : Ox.formatSRT(items) - ) + )) }); }