Need to ecape non ascii characters in javascript
<p>i belive this question has already be asked, but i can not find it.
The question is:
Is there any function to do the following ?</p>

<pre><code>var specialStr = 'ipsum áá éé lore';
var encodedStr = someFunction(specialStr);
// then encodedStr should be like 'ipsum \u00E1\u00E1 \u00E9\u00E9 lore'
</code></pre>

<p>I need to encode those character out of ascii range, and need to do it with that encoding (i don't know its name , is it unicode maybe?)</p>

<p>Thanks a lot.</p>
