Last active
March 10, 2016 10:52
-
-
Save laabroo/52e6a248a2a8745b2303 to your computer and use it in GitHub Desktop.
Cange encoding to UTF-8 on Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
laa = 'My Name' | |
broo = 'Laa BroÖntë' | |
laabroo = "laa= %s, broo= %s" % (str(laa), str(broo.decode('utf-8'))) | |
print laabroo | |
# laa= My Name, broo= Laa BroÖntë | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment