From 10426b66068f176c190b45e9c1274a067bb9f832 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 18 Apr 2011 06:06:20 +0900 Subject: [PATCH] don't lstrip the bom --- anki/importing/csvfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/anki/importing/csvfile.py b/anki/importing/csvfile.py index ea334acac..2a01a991c 100644 --- a/anki/importing/csvfile.py +++ b/anki/importing/csvfile.py @@ -67,7 +67,8 @@ class TextImporter(Importer): self.dialect = None self.fileobj = open(self.file, "rbU") self.data = self.fileobj.read() - self.data = self.data.lstrip(codecs.BOM_UTF8) + if self.data.startswith(codecs.BOM_UTF8): + self.data = self.data[len(codecs.BOM_UTF8):] def sub(s): return re.sub( "^\#.*", "", re.sub(