Closed Bug 1249935 Opened 9 years ago Closed 9 years ago

Ambiguous language in documentation for btoa()

Categories

(Developer Documentation Graveyard :: General, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: chrisv, Assigned: sheppy)

References

()

Details

:: Developer Documentation Request Request Type: Correction Gecko Version: unspecified Technical Contact: :: Details The 'Unicode Strings' section of the btoa() documentation has a rather vague statement "In most browsers, calling window.btoa() on a Unicode string will cause a Character Out Of Range exception". What is meant by a 'Unicode string' is not specified. In fact, ASCII text is Unicode, and indeed ASCII text is valid UTF-8. Naturally, with a 7-bit ASCII/Unicode string such as 'to', btoa('to') works ('dG8='). Also, with an 8-bit ASCII/Unicode string such as 'ça', btoa('ça') works ('52E='). Perhaps the statement should be "a multibyte Unicode string" rather than simply "a Unicode string". With a multi-byte Unicode string such as '†' (U+2020), btoa('†') gives an InvalidCharacterError.
I've largely rewritten the text here, based off a review of the specification. Hopefully this is less ambiguous now. :)
Assignee: nobody → eshepherd
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.