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

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -