Skip to content

Commit

Permalink
handle non-latin1 characters - fixes #154
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Feb 3, 2019
1 parent 3dc56d8 commit 2177946
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SourceMap.js
Expand Up @@ -4,7 +4,7 @@ let btoa = () => {
throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
};
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
btoa = window.btoa;
btoa = str => window.btoa(unescape(encodeURIComponent(str)));
} else if (typeof Buffer === 'function') {
btoa = str => Buffer.from(str, 'utf-8').toString('base64');
}
Expand Down

0 comments on commit 2177946

Please sign in to comment.