I'm writing my own function in a different language, and I want it to provide identical results if possible.
ASCII control characters (e.g. backspace, vertical tab, horizontal tab, line feed etc), unsafe characters like space , \ , < , > , { , } etc, and any character outside the ASCII charset is not allowed to be placed directly within URLs. Moreover, there are some characters that have special meaning within URLs.
Explanation: encodeURI() function is JavaScript function. It encodes special characters. The characters that can't be encoded are ',', '? ', '/', '@', '=', '&', '$', '+', '#', ':'.
URL Encoding (Percent Encoding) URLs can only be sent over the Internet using the ASCII character-set. Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
You can find information in the MDC documentation:
encodeURIComponent
escapes all characters except the following:
alphabetic, decimal digits,- _ . ! ~ * ' ( )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With