def _check_for_bom(self, first_row):
<EOL>if not first_row:<EOL><INDENT>return first_row<EOL><DEDENT>if not isinstance(first_row[<NUM_LIT:0>], str):<EOL><INDENT>return first_row<EOL><DEDENT>if not first_row[<NUM_LIT:0>]:<EOL><INDENT>return first_row<EOL><DEDENT>first_elt = first_row[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>if first_elt != _BOM:<EOL><INDENT>return first_row<EOL><DEDENT>first_row = first_row[<NUM_LIT:0>]<EOL>if len(first_row) > <NUM_LIT:1> and first_row[<NUM_LIT:1>] == self.quotechar:<EOL><INDENT>start = <NUM_LIT:2><EOL>quote = first_row[<NUM_LIT:1>]<EOL>end = first_row[<NUM_LIT:2>:].index(quote) + <NUM_LIT:2><EOL>new_row = first_row[start:end]<EOL>if len(first_row) > end + <NUM_LIT:1>:<EOL><INDENT>new_row += first_row[end + <NUM_LIT:1>:]<EOL><DEDENT>return [new_row]<EOL><DEDENT>elif len(first_row) > <NUM_LIT:1>:<EOL><INDENT>return [first_row[<NUM_LIT:1>:]]<EOL><DEDENT>else:<EOL><INDENT>return ["<STR_LIT>"]<EOL><DEDENT>
Checks whether the file begins with the BOM character.
If it does, remove it. In addition, if there is quoting
in the field subsequent to the BOM, remove it as well
because it technically takes place at the beginning of
the name, not the middle of it.