Consider this:
s = u"おはよう"
print len(s)
for c in s: print c
Output signal
4
お
は
よ
う
what i expect
Now with emojis:
s = u"hi 🏈"
Output
5
h
i
????
????
Why? How can i fix this? I used to look at different links, but could not plunge into it. Ideally, I would like to find a solution that works for both Japanese and emoticons, but if it is for ascii and emoticons, then Im fine with it too
source
share