Skip to content

Commit b3a3002

Browse files
committed
Use TextDecoder instead of String.fromCharCode
1 parent 48df453 commit b3a3002

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/helper/browser/createBase64WorkerFactory.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ function decodeBase64(base64, enableUnicode) {
55
for (var i = 0, n = binaryString.length; i < n; ++i) {
66
binaryView[i] = binaryString.charCodeAt(i);
77
}
8-
return String.fromCharCode.apply(null, new Uint16Array(binaryView.buffer));
8+
const decoder = new TextDecoder("utf-16le")
9+
return decoder.decode(new Uint16Array(binaryView.buffer));
910
}
1011
return binaryString;
1112
}

0 commit comments

Comments
 (0)