dankogai/js-base64

Character ă cannot btoa

wishcn opened this issue · 1 comments

Character ă cannot btoa

Error:

Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

btoa only accepts \x00 to \xff but 'ă'.charCodeAt(0) === 259 === 0x103 > 0xFF. It is a feature.

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa