mirror of https://github.com/balkian/gists
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
280 B
Python
9 lines
280 B
Python
9 years ago
|
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"
|