这是一个导致gettext
unicode character code 失败的 python 文件\u2191
。
texts = {
'first': _(u'Hello world'),
'fails': _(u'Arrow: \u2191'), # This code causes problems for gettext
'omitted': _(u'Innocent string here')
}
在命令行中运行C:\Python27\pythonw.exe C:\Python27\Tools\i18n\pygettext.py -d string_file string_file.py
时,结果 POT 文件包含正确的标头,但遇到 unicode 箭头时失败:
#: translate.py:2
msgid "Hello world"
msgstr ""
#: translate.py:3
msgid
我该怎么做才能让它与 unicode 字符代码一起使用?