前端base64遇到的坑:window.btoa中文报错的修复方案

204 阅读1分钟

问题是这样的:

同事在使用的过程中发现一个问题:

点击确定按钮后,有个报错提示。

如下截图所示:

图片

报错文本是:

invalidcharactererror failed to execute btoa on window the string to be encoded contains characters outside of the latin1 range


详情:前端base64遇到的坑:window.btoa中文报错的修复方案