import codecs
data = open('test.txt').read()
if data[:2] == codecs.BOM_UTF16_LE:
data = data[2:]
print data.decode('utf-16le')
或者:
data = codecs.open('test.txt', 'r', 'utf-16le').read()
if data[0] == codecs.BOM_UTF16_LE.decode('utf-16le'):
data = data[1:]
print data