mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Convert UTF8 encoded passwords to ISO-8859-1 for |R = 6| encryption (issue 6010)
For passwords where the encoding already is correct, the conversion is a no-op. Also, since `encodeURIComponent` might throw, we need to make sure that we handle that case too. Fixes 6010.
This commit is contained in:
parent
90982332bf
commit
44240798be
6 changed files with 109 additions and 2 deletions
|
@ -946,6 +946,10 @@ function stringToUTF8String(str) {
|
|||
return decodeURIComponent(escape(str));
|
||||
}
|
||||
|
||||
function utf8StringToString(str) {
|
||||
return unescape(encodeURIComponent(str));
|
||||
}
|
||||
|
||||
function isEmptyObj(obj) {
|
||||
for (var key in obj) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue