def writebom(self): """Write BOM, so excel can identify this as UTF8""" self.stream.write(u'\ufeff'.encode('utf8'))