Skip to content

Instantly share code, notes, and snippets.

@friskfly
Created January 1, 2013 07:57
Show Gist options
  • Save friskfly/4425818 to your computer and use it in GitHub Desktop.
Save friskfly/4425818 to your computer and use it in GitHub Desktop.
python 获取系统默认编码
import locale
import codecs
print locale.getpreferredencoding();
print codecs.lookup(locale.getpreferredencoding()).name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment