mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
58380e9408
commit
c7db673ffb
@ -114,6 +114,7 @@ class BIBTEX(CatalogPlugin):
|
|||||||
from calibre.library.save_to_disk import preprocess_template
|
from calibre.library.save_to_disk import preprocess_template
|
||||||
from calibre.utils.date import now as nowf
|
from calibre.utils.date import now as nowf
|
||||||
from calibre.utils.logging import default_log as log
|
from calibre.utils.logging import default_log as log
|
||||||
|
from calibre.utils.filenames import ascii_text
|
||||||
|
|
||||||
library_name = os.path.basename(db.library_path)
|
library_name = os.path.basename(db.library_path)
|
||||||
|
|
||||||
@ -251,7 +252,7 @@ class BIBTEX(CatalogPlugin):
|
|||||||
tpl_field = str(entry[tpl_field])
|
tpl_field = str(entry[tpl_field])
|
||||||
else :
|
else :
|
||||||
tpl_field = entry[tpl_field]
|
tpl_field = entry[tpl_field]
|
||||||
return tpl_field
|
return ascii_text(tpl_field)
|
||||||
else:
|
else:
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
@ -400,4 +401,3 @@ class BIBTEX(CatalogPlugin):
|
|||||||
for entry in data:
|
for entry in data:
|
||||||
outfile.write(create_bibtex_entry(entry, fields, bib_entry, template_citation,
|
outfile.write(create_bibtex_entry(entry, fields, bib_entry, template_citation,
|
||||||
bibtexc, db, citation_bibtex, addfiles_bibtex))
|
bibtexc, db, citation_bibtex, addfiles_bibtex))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user