Merge pull request #10530 from a4lg/fix-copytext-outofucs2

Fix copying on supplementary plane characters
This commit is contained in:
Tim van der Meij 2019-02-10 16:22:45 +01:00 committed by GitHub
commit dfe7d9bc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -2045,7 +2045,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
continue; continue;
} }
} }
toUnicode[charcode] = String.fromCharCode(code); toUnicode[charcode] = String.fromCodePoint(code);
} }
continue; continue;
} }
@ -2179,7 +2179,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); var w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1);
str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000);
} }
map[charCode] = String.fromCharCode.apply(String, str); map[charCode] = String.fromCodePoint.apply(String, str);
}); });
return new ToUnicodeMap(map); return new ToUnicodeMap(map);
}); });

View File

@ -75,6 +75,7 @@
!issue9940.pdf !issue9940.pdf
!issue10388_reduced.pdf !issue10388_reduced.pdf
!issue10438_reduced.pdf !issue10438_reduced.pdf
!issue10529.pdf
!bad-PageLabels.pdf !bad-PageLabels.pdf
!decodeACSuccessive.pdf !decodeACSuccessive.pdf
!filled-background.pdf !filled-background.pdf

BIN
test/pdfs/issue10529.pdf Normal file

Binary file not shown.

View File

@ -1451,6 +1451,13 @@
"type": "eq", "type": "eq",
"nativeImageDecoderSupport": "none" "nativeImageDecoderSupport": "none"
}, },
{ "id": "issue10529",
"file": "pdfs/issue10529.pdf",
"md5": "1a4d404a137c610ff0c747cbea3b8666",
"rounds": 1,
"link": false,
"type": "text"
},
{ "id": "issue6071", { "id": "issue6071",
"file": "pdfs/issue6071.pdf", "file": "pdfs/issue6071.pdf",
"md5": "2e08526d8e7c9ba4269fc12ef488d3eb", "md5": "2e08526d8e7c9ba4269fc12ef488d3eb",