js-escape. Encoding similar to escape function in JavaScript   [3.3.0]

^string.js-escape[]

Escapes a string. This method do the transformation similar to
escape function described in ECMA-262.
Strings, which were escaped using this method, can be unescaped in browser with JavaScript function
unescape.

To unescape a string use
^string:js-unescape[escaped]

Detailed information on ECMA-262 is available here:
http://www.ecma-international.org/publications/standards/Ecma-262.htm
(B.2.1)

Example
$value[abcd `+-=~!@#%&*()_ []{}<>:'",./?àáâãä]
<pre>^value.js-escape[]</pre>

Outputs…
abcd%20%60+-%3D%7E%21@%23%25%26*%28%29_%20%5B%5D%7B%7D%3C%3E%3A%27%22%2C./%3F%u0430%u0431%u0432%u0433%u0434


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 24.04.2016