From: Yury Delendik Date: Tue, 22 May 2012 03:15:09 +0000 (-0500) Subject: Adjust heuristic to properly handle unicode characters X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6971aec9f33558c8459733330b05fcc2f555ffd0;p=pdf.js.git Adjust heuristic to properly handle unicode characters --- diff --git a/src/evaluator.js b/src/evaluator.js index 1dab7de..1a8db14 100644 --- a/src/evaluator.js +++ b/src/evaluator.js @@ -611,8 +611,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { } } else if (octet == 0x3E) { if (token.length) { - // XXX guessing chars size by checking number size in the CMap - if (token.length <= 2 && properties.composite) + // Heuristic: guessing chars size by checking numbers sizes + // in the CMap entries. + if (token.length == 2 && properties.composite) properties.wideChars = false; if (token.length <= 4) { diff --git a/test/pdfs/issue1721.pdf.link b/test/pdfs/issue1721.pdf.link new file mode 100644 index 0000000..5a36166 --- /dev/null +++ b/test/pdfs/issue1721.pdf.link @@ -0,0 +1 @@ +http://www.lezarts.org/07oforhom/Faitsdivers/Hadopi/Le%20Rapport%20Hadopi,%20Intox.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 4706b68..be30d6c 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -550,6 +550,14 @@ "link": false, "type": "eq" }, + { "id": "issue1721", + "file": "pdfs/issue1721.pdf", + "md5": "b47177f9e5197a76ec498733ecab60e6", + "rounds": 1, + "pageLimit": 2, + "link": true, + "type": "eq" + }, { "id": "issue1243", "file": "pdfs/issue1243.pdf", "md5": "130c849b83513d5ac5e03c6421fc7489",