aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-07-24 12:50:54 +0000
committerMaximilian Krambach <[email protected]>2018-07-24 12:50:54 +0000
commit040b1ed40ada7c9ce095dec696406aea730e3766 (patch)
tree170fd80009432ca9b3ba08b4051f2f9b35a1c3fb /lang/js/src
parentjs: repair BrowserTextExtension test (diff)
downloadgpgme-040b1ed40ada7c9ce095dec696406aea730e3766.tar.gz
gpgme-040b1ed40ada7c9ce095dec696406aea730e3766.zip
js: Fix wrong encoding in received error messages
-- * The libgpg error strings arrive in the browser in a different encoding than used by browsers. Escaping and then decoding it should cover most languages in the supported browsers.
Diffstat (limited to '')
-rw-r--r--lang/js/src/Connection.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lang/js/src/Connection.js b/lang/js/src/Connection.js
index ef54dd64..d89fa724 100644
--- a/lang/js/src/Connection.js
+++ b/lang/js/src/Connection.js
@@ -240,7 +240,8 @@ class Answer{
switch (key) {
case 'type':
if (_decodedResponse.type === 'error'){
- return (gpgme_error('GNUPG_ERROR', _decodedResponse.msg));
+ return (gpgme_error('GNUPG_ERROR',
+ decodeURIComponent(escape(_decodedResponse.msg))));
} else if (poa.type.indexOf(_decodedResponse.type) < 0){
return gpgme_error('CONN_UNEXPECTED_ANSWER');
}