Просмотр исходного кода

fix UnicodeEncodeError

if the content contain Chinese or other Non-English language, it will throw UnicodeEncodeError
China-jp 9 лет назад
Родитель
Сommit
20213da443
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      flaskbb/utils/helpers.py

+ 1 - 1
flaskbb/utils/helpers.py

@@ -377,7 +377,7 @@ def format_quote(username, content):
     """
     profile_url = url_for('user.profile', username=username)
     content = "\n> ".join(content.strip().split('\n'))
-    quote = "**[{username}]({profile_url}) wrote:**\n> {content}\n".\
+    quote = u"**[{username}]({profile_url}) wrote:**\n> {content}\n".\
             format(username=username, profile_url=profile_url, content=content)
 
     return quote