Optimized creation of unicodedata.name strings per KG recommendation

This commit is contained in:
GRiker 2013-01-05 16:54:09 -07:00
parent 916ec953b5
commit 853434c19c

View File

@ -4422,14 +4422,12 @@ class CatalogBuilder(object):
Generate a legal XHTML anchor from unicode character.
Args:
c (unicode): character
c (unicode): character(s)
Return:
(str): legal XHTML anchor string of unicode character name
"""
fullname = ''
for cc in c:
fullname += unicodedata.name(unicode(cc))
fullname = u''.join(unicodedata.name(unicode(cc)) for cc in c)
terms = fullname.split()
return "_".join(terms)