mirror of
https://github.com/balkian/gists.git
synced 2025-08-23 15:12:21 +00:00
This commit is contained in:
9
coding.py
Normal file
9
coding.py
Normal file
@@ -0,0 +1,9 @@
|
||||
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"
|
Reference in New Issue
Block a user