What is URL encoding used for?
A
To compress URLs B
To style hyperlinks C
To convert special characters into a valid URL format D
To encrypt web addresses
Analysis & Theory
URL encoding converts characters into a format that can be transmitted over the Internet in a URL.
What character does `%20` represent in URL encoding?
A
Tab B
Slash (/) C
Space D
Newline
Analysis & Theory
`%20` is the URL-encoded representation of a space character.
Why must URLs be encoded?
A
To reduce file size B
To hide sensitive data C
Because some characters have special meanings in URLs D
To improve SEO
Analysis & Theory
Characters like `?`, `&`, `=`, and spaces can break URLs or be misinterpreted, so they must be encoded.
What is the encoded value of the ampersand (`&`) in a URL?
A
%20 B
%26 C
& D
%2F
Analysis & Theory
`%26` is the URL-encoded value of the ampersand character `&`.
Which of these characters does **not** need to be URL encoded?
A
A-Z letters B
Spaces C
Question mark (?) D
Colon (:)
Analysis & Theory
Alphanumeric characters (A-Z, a-z, 0-9) do not need to be encoded.
What is the URL-encoded form of `/` (slash)?
A
%3A B
%2F C
%2C D
%40
Analysis & Theory
`%2F` is the encoded value of the forward slash `/`.
What does `%3D` stand for in URL encoding?
A
= B
# C
3 D
?
Analysis & Theory
`%3D` is the encoded version of the equals sign `=`.
Which tool or function is commonly used to encode URLs in JavaScript?
A
encode() B
URI.encode() C
encodeURIComponent() D
urlSafe()
Analysis & Theory
`encodeURIComponent()` safely encodes special characters in a URL string.
How is the `#` (hash) character encoded in URLs?
A
%23 B
%3C C
%21 D
%25
Analysis & Theory
`%23` is the encoded form of the `#` symbol.
What is the correct encoded value of the string `Hello World!`?
A
Hello+World! B
Hello%20World%21 C
Hello%World% D
Hello_World!
Analysis & Theory
`Hello%20World%21` encodes the space (`%20`) and exclamation mark (`%21`) for use in URLs.