HTML URL Encode
- Which of the following is not encode by encodeURI() function?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
encodeURI() function is JavaScript function. It encodes special characters. The characters that can’t be encoded are ‘,’, ‘?’, ‘/’, ‘@’, ‘=’, ‘&’, ‘$’, ‘+’, ‘#’, ‘:’. Its syntax is encodeURI(uri), uri is the URI that to be encoded
- What is the URL Encode for tab character?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
For tab character URL encode is %09, its Decimal value is 9 and Hex value is 09, %08 is URL encode for backspace, its Decimal value is 8 and Hex value is 08, %0d is URL Encode for carriage return, Decimal value is 13 and Hex value is 0d, %0a is URL encode for linefeed, Decimal value is 10 and Hex value is 0a.
- Which of the following is not a reserved character?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Reserved characters are ‘@’, ‘=’, ‘?’, ‘:’, ‘;’, ‘/’, ‘,’, ‘+’, ‘$’, ‘&’. Unsafe characters are space, ‘”’, ‘>’, ‘<’, ‘#’, ‘%’, ‘{‘, ‘}’, ‘~’, ‘^’, ‘[‘, ‘|’, ‘\’, ‘`’, ‘]’. There is a URL Encode for all of these characters. Apart from URL Encode there is Decimal and Hex value also for the characters.
- What is URL encode of ‘&’?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
URL encoding of ‘&’ is %26, its Decimal value is 38 and the Hex value is 26. %24 is URL encode of ‘$’ whose Decimal value is 36 and Hex value is 24, %2c is URL encode of ‘,’ its Decimal value is 44 and Hex value is 2c, %3d is URL encode of ‘=’, its Decimal value is 61 and Hex value is 3d.
- Which function is used in JavaScript for URL encoding?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
There are some built in functions in JavaScript, ASP and PHP for URL encoding. JavaScript use encodeURI() function. ASP uses Server.URLEncode() function, rawurlencode() function is used by PHP. Space is encoded as %20 by JavaScript function.