From 916ec953b551d7c109147e8a0dd0bf15777b1a28 Mon Sep 17 00:00:00 2001 From: GRiker Date: Sat, 5 Jan 2013 07:13:58 -0700 Subject: [PATCH] Resolved issue with catalog generation using Hungarian UI and author_sort beginning with multiple letter groups --- src/calibre/library/catalogs/epub_mobi_builder.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/calibre/library/catalogs/epub_mobi_builder.py b/src/calibre/library/catalogs/epub_mobi_builder.py index 65ed89da5c..f4a1032b58 100644 --- a/src/calibre/library/catalogs/epub_mobi_builder.py +++ b/src/calibre/library/catalogs/epub_mobi_builder.py @@ -663,9 +663,9 @@ class CatalogBuilder(object): # Hack to force the cataloged leading letter to be # an unadorned character if the accented version sorts before the unaccented exceptions = { - u'Ä': u'A', - u'Ö': u'O', - u'Ü': u'U' + u'Ä': u'A', + u'Ö': u'O', + u'Ü': u'U' } if key is not None: @@ -3473,7 +3473,7 @@ class CatalogBuilder(object): self.play_order += 1 navLabelTag = Tag(ncx_soup, 'navLabel') textTag = Tag(ncx_soup, 'text') - if len(authors_by_letter[1]) > 1: + if authors_by_letter[1] == self.SYMBOLS: fmt_string = _(u"Authors beginning with %s") else: fmt_string = _(u"Authors beginning with '%s'") @@ -4425,9 +4425,11 @@ class CatalogBuilder(object): c (unicode): character Return: - (str): legal XHTML anchor string of unicode charactar name + (str): legal XHTML anchor string of unicode character name """ - fullname = unicodedata.name(unicode(c)) + fullname = '' + for cc in c: + fullname += unicodedata.name(unicode(cc)) terms = fullname.split() return "_".join(terms)