【发布时间】:2018-10-02 13:31:44
【问题描述】:
这是一个 python 文件,它导致 gettext 在 unicode 字符代码 \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 字符代码一起使用?
【问题讨论】:
标签: python unicode translation gettext pot