I am from Vietnam (we use special characters). I would like to save a cookie value in unicode encoding to preserve those special characters, but I don't know how to proceed.
Asked
Active
Viewed 2,115 times
1 Answers
6
Quốc Ngữ characters can be represented in Unicode - in consequence, you may use theencodeURIComponent()
function to set the cookie content, and then thedecodeURIComponent()
function to get the original value back.
There's a neat post here about this, How to store other languages (unicode) in cookies and get it back again.