Catalog generation: Ensure all citation keys in BiBTeX catalogs have only ascii characters. Fixes #1646239 [bibtex labels](https://bugs.launchpad.net/calibre/+bug/1646239)

This commit is contained in:
Kovid Goyal 2016-12-01 14:54:20 +05:30
parent 58380e9408
commit c7db673ffb

View File

@ -114,6 +114,7 @@ class BIBTEX(CatalogPlugin):
from calibre.library.save_to_disk import preprocess_template
from calibre.utils.date import now as nowf
from calibre.utils.logging import default_log as log
from calibre.utils.filenames import ascii_text
library_name = os.path.basename(db.library_path)
@ -251,7 +252,7 @@ class BIBTEX(CatalogPlugin):
tpl_field = str(entry[tpl_field])
else :
tpl_field = entry[tpl_field]
return tpl_field
return ascii_text(tpl_field)
else:
return u''
@ -400,4 +401,3 @@ class BIBTEX(CatalogPlugin):
for entry in data:
outfile.write(create_bibtex_entry(entry, fields, bib_entry, template_citation,
bibtexc, db, citation_bibtex, addfiles_bibtex))