From 3821ecbf4ac442cbaad7a1fc0d8c20136bbfe32a Mon Sep 17 00:00:00 2001 From: LysandreJik Date: Thu, 11 Jul 2019 20:16:28 -0400 Subject: [PATCH] Byte order mark management in TSV glue reading. --- examples/utils_glue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/utils_glue.py b/examples/utils_glue.py index 5ad36abf10..bba9a901a8 100644 --- a/examples/utils_glue.py +++ b/examples/utils_glue.py @@ -78,7 +78,7 @@ class DataProcessor(object): @classmethod def _read_tsv(cls, input_file, quotechar=None): """Reads a tab separated value file.""" - with open(input_file, "r", encoding="utf-8") as f: + with open(input_file, "r", encoding="utf-8-sig") as f: reader = csv.reader(f, delimiter="\t", quotechar=quotechar) lines = [] for line in reader: