decode is not available in python 3

trivial bugfix for master
This commit is contained in:
Sébastien Loriot 2015-02-10 11:15:59 +01:00
parent 63945bdac9
commit aac974b83d
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ def protect_upper_case(title):
def protect_accentuated_letters(authors):
res=authors.replace(u"é",r"{\'e}").replace(u"ä",r"{\"a}").replace(u"ö",r"{\"o}").replace(u"ñ",r"{\~n}").replace(u"ã",r"{\~a}").replace(u"ë",r"{\"e}").replace("%","")
try:
res.decode('ascii')
res.encode('ascii')
except UnicodeEncodeError:
stderr.write("WARNING: a non ascii character has been found in author string for bibtex (probably a non-handled accentuated letter)."
"Check the new package added and update the function protect_accentuated_letters in Documentation/scripts/generate_how_to_cite.py\n\n")