HTML URL Encode


  1. Which of the following is not encode by encodeURI() function?











  1. 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


  1. What is the URL Encode for tab character?











  1. 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.



  1. Which of the following is not a reserved character?











  1. 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.


  1. What is URL encode of ‘&’?











  1. 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.



  1. Which function is used in JavaScript for URL encoding?











  1. 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.