Skip to content

Instantly share code, notes, and snippets.

@dervn
Created March 8, 2011 01:35
Show Gist options
  • Save dervn/859672 to your computer and use it in GitHub Desktop.
Save dervn/859672 to your computer and use it in GitHub Desktop.
unicode处理 errors='ignore'
#‘ignore’ (just leave the character out of the Unicode result)
#replace
unicode('\x80abc', errors='ignore')
text = "第二十集神兵天降 第七章 旦雅之危"
text.decode('gb2312',errors='ignore')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment