Initial ToUnicode modifications

This commit is contained in:
notmasteryet 2011-11-24 09:38:09 -06:00
parent 59d9dfc014
commit 709dc1a0c9
3 changed files with 55 additions and 10 deletions

View file

@ -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);