Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

encodeURI

encodeURI(String): String

The encodeURI() function encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).

Assumes that the URI is a complete URI, so does not encode reserved characters that have special meaning in the URI.

encodeURI replaces all characters except the following with the appropriate UTF-8 escape sequences:

Type Includes

Reserved characters

; , / ? : @ & = $

Unescaped characters

alphabetic, decimal digits, - _ . ! ~ * ' ( )

Number sign

#