In a URL / Uniform Resource Identifier (URI), you have reserved character that are part of the URL syntax that cannot be used.
For instance:
Percent-encoding, also known as Url Encoding maps (ie encode) :
Example:
Although it is known as URL encoding it is, in fact, used more generally within the main Uniform Resource Identifier (URI) set, which includes both:
It is also used in the preparation of data of the application/x-www-form-urlencoded media type, as is often used in the submission of HTML form data
The purpose detailed is:
let uri = "sftp://hostname\\foo:Pwd#Pwd@host:port";
console.log("The encoded URI is: "+encodeURI(uri));
The # must normaly be encoded as %23