Unicode Python3 unidecode can';转换西里尔字母

Unicode Python3 unidecode can';转换西里尔字母,unicode,python-3.x,cyrillic,Unicode,Python 3.x,Cyrillic,我正在尝试使用Python3中的unidecode库删除俄语单词(西里尔字母)中的重音。unidecode库适用于其他示例,但不适用于俄语单词。任何帮助都将不胜感激 俄语单词变成了“ND3/4D3/4D+-NDuID1/2D,N”,而不是去掉“e”字母上的重音,这不是我们想要的 Python 3.3.0 (default, Oct 24 2012, 14:30:03) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux Type "help", "co

我正在尝试使用Python3中的unidecode库删除俄语单词(西里尔字母)中的重音。unidecode库适用于其他示例,但不适用于俄语单词。任何帮助都将不胜感激

俄语单词变成了“ND3/4D3/4D+-NDuID1/2D,N”,而不是去掉“e”字母上的重音,这不是我们想要的

Python 3.3.0 (default, Oct 24 2012, 14:30:03)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> # -*- coding: utf-8 -*-
...
>>> from unidecode import unidecode
>>> print(unidecode(u"Cœur"))
CAur
>>> print(unidecode(u"сообще́ния"))
ND3/4D3/4D+-NDuID1/2D,N
>>>
我试过Mac OSX

$ echo $LANG
en_US.utf-8
$ python3
Python 3.3.2 (default, Aug 22 2013, 12:33:42)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from unidecode import unidecode
>>> print(unidecode(u"Cœur"))
Coeur
>>> print(unidecode(u"сообще́ния"))
soobshcheniia
您可以尝试设置LANG变量。

我在Mac OSX上尝试过

$ echo $LANG
en_US.utf-8
$ python3
Python 3.3.2 (default, Aug 22 2013, 12:33:42)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from unidecode import unidecode
>>> print(unidecode(u"Cœur"))
Coeur
>>> print(unidecode(u"сообще́ния"))
soobshcheniia

您可以尝试设置LANG变量。

谢谢,这确实是LANG和LC_*设置。我用的是en_-US,我把它设置为en_-US.UTF-8,它成功了。谢谢,它确实是LANG和LC_*设置。我用的是en_-US,我把它设为en_-US.UTF-8,它成功了。