mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
don't lstrip the bom
This commit is contained in:
parent
3af48542e4
commit
10426b6606
1 changed files with 2 additions and 1 deletions
|
@ -67,7 +67,8 @@ class TextImporter(Importer):
|
||||||
self.dialect = None
|
self.dialect = None
|
||||||
self.fileobj = open(self.file, "rbU")
|
self.fileobj = open(self.file, "rbU")
|
||||||
self.data = self.fileobj.read()
|
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):
|
def sub(s):
|
||||||
return re.sub(
|
return re.sub(
|
||||||
"^\#.*", "", re.sub(
|
"^\#.*", "", re.sub(
|
||||||
|
|
Loading…
Reference in a new issue