GTI: Add utf16 file handling

This commit is contained in:
Worros 2010-11-15 13:39:36 +08:00
parent a4885243de
commit f7f8122af8

View File

@ -238,7 +238,7 @@ class SummaryImporter:
self.filelist = {} self.filelist = {}
def readFile(self, tsc, filename): def readFile(self, tsc, filename):
codepage = ["utf8"] codepage = ["utf8", "utf16"]
whole_file = None whole_file = None
tsc.codepage tsc.codepage
@ -248,7 +248,8 @@ class SummaryImporter:
whole_file = in_fh.read() whole_file = in_fh.read()
in_fh.close() in_fh.close()
break break
except: except UnicodeDecodeError, e:
log.warn(_("GTI.readFile: '%s'") % e)
pass pass
return whole_file return whole_file