From: Cristy Date: Thu, 28 Mar 2019 23:52:22 +0000 (-0400) Subject: https://imagemagick.org/discourse-server/viewtopic.php?t=35741 X-Git-Tag: 7.0.8-36~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=842ec075de3b43a8de8010028dc69b834e2ca60f;p=imagemagick https://imagemagick.org/discourse-server/viewtopic.php?t=35741 --- diff --git a/coders/pdf.c b/coders/pdf.c index 4ed397549..77c90eb06 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -2973,11 +2973,35 @@ RestoreMSCWarning utf16=ConvertUTF8ToUTF16((unsigned char *) basename,&length); if (utf16 != (wchar_t *) NULL) { - (void) FormatLocaleString(buffer,MagickPathExtent,"/Title (\xfe\xff"); + unsigned char + hex_digits[16]; + + hex_digits[0]='0'; + hex_digits[1]='1'; + hex_digits[2]='2'; + hex_digits[3]='3'; + hex_digits[4]='4'; + hex_digits[5]='5'; + hex_digits[6]='6'; + hex_digits[7]='7'; + hex_digits[8]='8'; + hex_digits[9]='9'; + hex_digits[10]='A'; + hex_digits[11]='B'; + hex_digits[12]='C'; + hex_digits[13]='D'; + hex_digits[14]='E'; + hex_digits[15]='F'; + (void) FormatLocaleString(buffer,MagickPathExtent,"/Title > 4) & 0x0f]); + (void) WriteBlobByte(image,hex_digits[utf16[i] & 0x0f]); + } + (void) FormatLocaleString(buffer,MagickPathExtent,">\n"); utf16=(wchar_t *) RelinquishMagickMemory(utf16); } }