[ttx] Strip the BOM only in XML files
This commit is contained in:
parent
1a58912a60
commit
fefe5d5c46
@ -285,8 +285,10 @@ def guessFileType(fileName):
|
||||
f = open(fileName, "rb")
|
||||
except IOError:
|
||||
return None
|
||||
header = f.read(256).lstrip(b'\xef\xbb\xbf')
|
||||
header = f.read(256)
|
||||
f.close()
|
||||
if header.startswith(b'\xef\xbb\xbf<?xml'):
|
||||
header = header.lstrip(b'\xef\xbb\xbf')
|
||||
cr, tp = getMacCreatorAndType(fileName)
|
||||
if tp in ("sfnt", "FFIL"):
|
||||
return "TTF"
|
||||
|
Loading…
x
Reference in New Issue
Block a user