312-39 practice question 26 of 35

Which encoding replaces unusual ASCII characters with "%" followed by the character’s two-digit ASCII code expressed in hexadecimal?

Full set: 100 questions
Answer options
A: Unicode Encoding
B: UTF Encoding
C: Base64 Encoding
D: URL Encoding Correct answer
Correct Answer:
D. URL Encoding
Explanation

The encoding that replaces characters with a percent sign (%) followed by the character's two-digit hexadecimal ASCII value is known as URL encoding, or more formally, percent-encoding. This method is defined in the standard for Uniform Resource Identifiers (URIs). It is essential for ensuring that data transmitted as part of a URL is correctly interpreted, as certain characters have special meanings (e.g., ?, &, /) or are not allowed within a URL. By encoding them, they can be safely transmitted and decoded by the receiving server.

Why Incorrect

A: Unicode is a character encoding standard that defines a vast set of characters, but it is not the %hh encoding scheme itself. B: UTF (e.g., UTF-8) is a specific method for representing Unicode characters as a sequence of bytes. The %hh format is used to make these bytes URL-safe. C: Base64 encoding is a method to represent binary data in an ASCII string format using a 64-character alphabet; it does not use the % prefix.

References

1. Berners-Lee, T., Fielding, R., & Masinter, L. (2005). RFC 3986: Uniform Resource Identifier (URI): Generic Syntax. Internet Engineering Task Force (IETF). Section 2.1, "Percent-Encoding," provides the formal definition of this mechanism.

2. Stanford University. (n.d.). CS142 Web Applications, Lecture 2: HTTP & The Web. Slide 13, "URL Encoding," describes the use of % followed by the hex ASCII value for special characters.

Scroll to Top