Reputation: 329
I'm trying to remove last character with [:-1]
from the words that aren't written in latin alphabet (header has # -*- coding: utf-8 -*-
set) and removed character gets replaced with ? in terminal output. Any suggestions?
code example:
# -*- coding: utf-8 -*-
word = "სკამი"[:-1]
print word
output in terminal
სკამ?
Upvotes: 0
Views: 2376
Reputation: 799062
print "სკამი".decode('utf-8')[:-1]
print u"სკამი"[:-1]
Upvotes: 1