javascript - CryptoJS not decrypting non-Latin characters faithfully -
i trying use cryptojs aes, so:
var msg = "café"; var key = "something"; var c = cryptojs.aes.encrypt(msg, key).tostring(); cryptojs.aes.decrypt(c, key).tostring(cryptojs.enc.latin1);
unfortunately returns café
, not café
. latin1 not right encoding use, can't find better one. there solution?
thanks.
you missing format
proper way using cryptojs.enc.utf8
so, please try:
cryptojs.aes.decrypt(c, key).tostring(cryptojs.enc.utf8);
Comments
Post a Comment