Created
February 18, 2013 16:28
-
-
Save tomoemon/4978592 to your computer and use it in GitHub Desktop.
python various encoding
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
-*- coding: utf-8 -*- | |
import sys | |
import locale | |
sys.stdout.write(repr(sys.stdout.encoding) + "\n") # on redirecting, set None | |
sys.stdout.write(repr(sys.getdefaultencoding()) + "\n") # used as default encoding when encoding or decoding | |
sys.stdout.write(repr(sys.getfilesystemencoding()) + "\n") | |
sys.stdout.write(repr(locale.getpreferredencoding()) + "\n") | |
sys.stdout.write(u"あいうえお\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment