mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Initial ToUnicode modifications
This commit is contained in:
parent
59d9dfc014
commit
709dc1a0c9
3 changed files with 55 additions and 10 deletions
|
@ -512,6 +512,7 @@ var PartialEvaluator = (function partialEvaluator() {
|
|||
error('Encoding is not a Name nor a Dict');
|
||||
}
|
||||
}
|
||||
|
||||
properties.differences = differences;
|
||||
properties.baseEncoding = baseEncoding;
|
||||
properties.hasEncoding = hasEncoding;
|
||||
|
@ -595,9 +596,18 @@ var PartialEvaluator = (function partialEvaluator() {
|
|||
}
|
||||
} else if (byte == 0x3E) {
|
||||
if (token.length) {
|
||||
// parsing hex number
|
||||
tokens.push(parseInt(token, 16));
|
||||
token = '';
|
||||
if (token.length <= 4) {
|
||||
// parsing hex number
|
||||
tokens.push(parseInt(token, 16));
|
||||
token = '';
|
||||
} else {
|
||||
// parsing hex UTF-16BE numbers
|
||||
var str = [];
|
||||
for (var i = 0, ii = token.length; i < ii; i += 4)
|
||||
str.push(parseInt(token.substr(i, 4), 16));
|
||||
tokens.push(String.fromCharCode.apply(String, str));
|
||||
token = '';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
token += String.fromCharCode(byte);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue