This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

escape

Summary

Deprecated

The deprecated escape() function encodes a string so it can be read on all computers.

Syntax

escape(str)
str
Required. A String to be encoded

Return Value

Returns a string value in Unicode format that contains the encoded contents of the str parameter.

Examples

unescape("webplatform"); // "webplatform"
unescape("ümlaut"); // "%FCmlaut"
unescape("日本語"); // "%u65E5%u672C%u8A9E"

Remarks

All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with % xx encoding, where xx is equivalent to the hexadecimal number representing the character. For example, a space is returned as “%20.”

Characters with a value greater than 255 are stored using the %u xxxx format.

Notes

The escape function should not be used to encode URIs. Use encodeURI and encodeURIComponent functions instead

See also

Related articles

Deprecated

Other articles

Attributions

  • Microsoft Developer Network: Article