删除python输出中的问号

时间:2015-02-10 20:57:40

标签: python string python-2.7 utf-8

我正在尝试从未使用拉丁字母书写的字词中删除带有[:-1]的最后一个字符(标题已设置# -*- coding: utf-8 -*-)并删除了已删除的字符?在终端输出。有什么建议吗?

代码示例:

# -*- coding: utf-8 -*-

word = "სკამი"[:-1]
print word

终端输出

სკამ?

1 个答案:

答案 0 :(得分:1)

Stop using bytestrings

print "სკამი".decode('utf-8')[:-1]
print u"სკამი"[:-1]
相关问题