summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog4
-rw-r--r--Build/source/texk/dvipdfm-x/pdfdoc.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index 079c27dd113..c6dcfecc7a2 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-23 Masamichi HOSODA <trueroad@trueroad.jp>
+
+ * pdfdoc.c: Support UTF-16 with null bytes as labels.
+
2016-02-23 Jonathan Kew <jfkthame@gmail.com>
* dvicodes.h, dvi.c, pdfdev.[ch]: Support xetex 0.99995 output
diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.c b/Build/source/texk/dvipdfm-x/pdfdoc.c
index 27a67715d35..dd4cdf81a57 100644
--- a/Build/source/texk/dvipdfm-x/pdfdoc.c
+++ b/Build/source/texk/dvipdfm-x/pdfdoc.c
@@ -1595,6 +1595,7 @@ pdf_doc_add_goto (pdf_obj *annot_dict)
{
pdf_obj *subtype = NULL, *A = NULL, *S = NULL, *D = NULL, *D_new, *dict;
const char *dest, *key;
+ int destlen = 0;
if (!pdoc.check_gotos)
return;
@@ -1641,8 +1642,10 @@ pdf_doc_add_goto (pdf_obj *annot_dict)
}
}
- if (PDF_OBJ_STRINGTYPE(D))
+ if (PDF_OBJ_STRINGTYPE(D)) {
dest = (char *) pdf_string_value(D);
+ destlen = pdf_string_length(D);
+ }
#if 0
/* Names as destinations are not supported by dvipdfmx */
else if (PDF_OBJ_NAMETYPE(D))
@@ -1655,7 +1658,7 @@ pdf_doc_add_goto (pdf_obj *annot_dict)
else
goto error;
- D_new = ht_lookup_table(&pdoc.gotos, dest, strlen(dest));
+ D_new = ht_lookup_table(&pdoc.gotos, dest, destlen);
if (!D_new) {
char buf[10];
@@ -1664,7 +1667,7 @@ pdf_doc_add_goto (pdf_obj *annot_dict)
*/
sprintf(buf, "%x", ht_table_size(&pdoc.gotos));
D_new = pdf_new_string(buf, strlen(buf));
- ht_append_table(&pdoc.gotos, dest, strlen(dest), D_new);
+ ht_append_table(&pdoc.gotos, dest, destlen, D_new);
}
{