First, some background: I\'m developing a web application using Python. All of my (text) files are currently stored in UTF-8 with the BOM. This includes all my HTML template
Check the first character after decoding to see if it's the BOM:
if u.startswith(u'\ufeff'): u = u[1:]