Skip to content

Instantly share code, notes, and snippets.

@lartpang
Created March 25, 2019 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lartpang/478b587e6b4ade38bdd9ba122b0f70ae to your computer and use it in GitHub Desktop.
Save lartpang/478b587e6b4ade38bdd9ba122b0f70ae to your computer and use it in GitHub Desktop.
一种针对平台编码方式编码的方法
# -*- coding:YTF-8 -*-
import sys
type = sys.getfilesystemencoding()
...
decode('UTF-8').encode(type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment