"String contains an invalid character" even though all characters are valid
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
People
(Reporter: florine, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
Steps to reproduce:
Run atob("+")
in the console.
Actual results:
I receive the error "InvalidCharacterError: String contains an invalid character". This is confusing because all characters in the string are valid base 64.
Expected results:
I should receive an error saying that the string is incorrectly encoded.
Comment 1•5 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
Hi,
I have manage to reproduced this using the Release version 75 and latest Nightly build 77.0a1.
In Chrome following the same steps the error received is:
"Uncaught DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded."
I will move this over to a component so developers can take a look over it. If this is not the correct component please feel free to change it to an appropriate one.
Thanks for the suggestion.
Comment 2•5 years ago
|
||
Moving to "DOM: Core & HTML", because atob
is an HTML function.
Updated•2 years ago
|
Description
•