You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The encoding function correctly handles ampersand before the other characters. For example, the string me & "you" is encoded as me & "you", and the string " is encoded as ".
The decoding function, however, incorrectly decodes & into & before handling the other characters. So while it correctly decodes the first example above, it decodes the second example (") to " (a single double quote), which is not correct.
Instead, the decoding function should decode the ampersand last:
Example
The following example shows a pair of hand-written HTML encoding and decoding functions:
The encoding function correctly handles ampersand before the other characters. For example, the string me & "you" is encoded as me & "you", and the string " is encoded as ".
The decoding function, however, incorrectly decodes & into & before handling the other characters. So while it correctly decodes the first example above, it decodes the second example (") to " (a single double quote), which is not correct.
Instead, the decoding function should decode the ampersand last:
The text was updated successfully, but these errors were encountered: