summaryrefslogtreecommitdiff
path: root/scripts/bin2hex.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-07-18 15:21:09 +0200
committerSimon Bünzli <zeniko@gmail.com>2014-07-18 15:21:09 +0200
commit1d39d9d10c7fa83bb509e50ab135f5f97c2810eb (patch)
tree8af5303dff2f7c366fd063ef8ffd237b46428c45 /scripts/bin2hex.c
parent1e91bb1c4b55060809154ff7ba6f210f74499c4b (diff)
downloadmupdf-1d39d9d10c7fa83bb509e50ab135f5f97c2810eb.tar.xz
hex-encode UTF-16 strings when writing PDF
fmt_obj calculates whether a string is better hex-encoded or written using escapes. Due to a bug, '\0' is considered to be escapable same as '\n' when instead it would have to be written as '\000'. Since UTF-16 strings tend to consist of many '\0' bytes, their octal encoded form is much longer than their hex encoded form. The issue is that the first argument to strchr contains an unintended trailing '\0' which has to be special-cased first.
Diffstat (limited to 'scripts/bin2hex.c')
0 files changed, 0 insertions, 0 deletions