mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Fix incorrect encoding for some chinese characters in the PDF Outline (Table of Contents). Fixes #1416222 [Incorrect TOC entries in PDF files converted from Chinese EPUB file](https://bugs.launchpad.net/calibre/+bug/1416222)
This commit is contained in:
parent
9e7d1a6ed4
commit
2a32abf933
@ -128,8 +128,7 @@ class String(unicode):
|
|||||||
class UTF16String(unicode):
|
class UTF16String(unicode):
|
||||||
|
|
||||||
def pdf_serialize(self, stream):
|
def pdf_serialize(self, stream):
|
||||||
s = self.replace('\\', '\\\\')
|
raw = codecs.BOM_UTF16_BE + self.encode('utf-16-be').replace(b'\\', b'\\\\')
|
||||||
raw = codecs.BOM_UTF16_BE + s.encode('utf-16-be')
|
|
||||||
stream.write(b'('+escape_unbalanced_parantheses(raw)+b')')
|
stream.write(b'('+escape_unbalanced_parantheses(raw)+b')')
|
||||||
|
|
||||||
class Dictionary(dict):
|
class Dictionary(dict):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user