1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-25 02:32:28 +00:00
gists/repos/6b6906b97267a0c5ac52/coding.py

9 lines
280 B
Python
Raw Normal View History

2015-02-25 20:46:09 +00:00
a = u"codificación"
print a # u"codificación"
print type(a) # <type 'unicode'>
b = a.encode("utf-8")
print b # codificación # But it depends on your terminal settings
print type(b) # <type 'str'>
c = b.decode("utf-8")
print type(c) # <type 'unicode'>
print c # u"codificación"