I need to convert large UTF-8 strings into ASCII. It should be reversible, and ideally a quick/lightweight algorithm.
How can I do this? I need the source
An implementation of the quote() function might do what you want. My version can be found here
quote()
You can use eval() to reverse the encoding:
eval()
var foo = 'Hägar'; var quotedFoo = quote(foo); var unquotedFoo = eval(quotedFoo); alert(foo === unquotedFoo);