删除 python 输出中的问号

removing the question mark in python output

我正在尝试从非拉丁字母表(header 设置了 # -*- coding: utf-8 -*-)中删除带有 [:-1] 的最后一个字符,并且删除的字符被替换为?在终端输出中。有什么建议吗?

代码示例:

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

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

终端输出

სკამ?

Stop using bytestrings.

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