timofurrer / colorful

Terminal string styling done right, in Python :snake: :tada:
MIT License
525 stars 23 forks source link

Can't support utf-8? #6

Closed elechuanwu closed 6 years ago

elechuanwu commented 7 years ago

Using colorful can not print Chinese characters. This module supports ASCII only?

timofurrer commented 7 years ago

Can you provide an example which reproduces your issue?

elechuanwu commented 7 years ago

image

timofurrer commented 7 years ago

Seems to be a problem. I'll have a look at it as soon as I have some time.

In the meantime you can explicitly convert it to unicode before printing:

print(unicode(colorful.red(u'🐧🎉🐧')))

When using Python 3 it won't be a problem:

print(colorful.red('🐧🎉🐧'))
print(colorful.red('漢字'))
timofurrer commented 6 years ago

Fixed with #9

elechuanwu commented 6 years ago

Thank you.