Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript: What characters are not encoded by encodeURIComponent?

I'm writing my own function in a different language, and I want it to provide identical results if possible.

like image 569
700 Software Avatar asked Jun 07 '11 14:06

700 Software


People also ask

What characters Cannot be URL encoded?

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.

Which of the following is not encoded by encodeURI () function?

Explanation: encodeURI() function is JavaScript function. It encodes special characters. The characters that can't be encoded are ',', '? ', '/', '@', '=', '&', '$', '+', '#', ':'.

What characters are URL encoded?

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.


1 Answers

You can find information in the MDC documentation:

encodeURIComponent escapes all characters except the following:
alphabetic, decimal digits, - _ . ! ~ * ' ( )

like image 84
Felix Kling Avatar answered Nov 15 '22 08:11

Felix Kling