From c7db673ffb19af3dad74044e6c9cb9746102fec4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 1 Dec 2016 14:54:20 +0530 Subject: [PATCH] Catalog generation: Ensure all citation keys in BiBTeX catalogs have only ascii characters. Fixes #1646239 [bibtex labels](https://bugs.launchpad.net/calibre/+bug/1646239) --- src/calibre/library/catalogs/bibtex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/library/catalogs/bibtex.py b/src/calibre/library/catalogs/bibtex.py index 2e6f488c78..94219fa18f 100644 --- a/src/calibre/library/catalogs/bibtex.py +++ b/src/calibre/library/catalogs/bibtex.py @@ -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)) -