Skip to content

Instantly share code, notes, and snippets.

@aaronsaunders
Created October 1, 2013 08:38
Show Gist options
  • Save aaronsaunders/6775512 to your computer and use it in GitHub Desktop.
Save aaronsaunders/6775512 to your computer and use it in GitHub Desktop.
>print data_list '\xef\xbb\xbfsome_data1' source: http://stackoverflow.com/questions/18664712/split-function-add-xef-xbb-xbf-n-to-my-list UTF-8 BOM in the beginning. To get rid of it, first decode your file contents to unicode.
fp = open("file.txt")
data = fp.read().decode("utf-8-sig").encode("utf-8")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment