From bce9fa0d7e7cb9605db38767047f7b44b3763176 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Thu, 18 Jul 2019 14:50:57 +1200 Subject: [PATCH] HACK PATCH --- python/samba/gp_parse/gp_inf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/samba/gp_parse/gp_inf.py b/python/samba/gp_parse/gp_inf.py index 79e28159f1f..2f4718d9954 100644 --- a/python/samba/gp_parse/gp_inf.py +++ b/python/samba/gp_parse/gp_inf.py @@ -29,11 +29,12 @@ from samba.gp_parse import GPParser # [MS-GPSB] Security Protocol Extension class GptTmplInfParser(GPParser): sections = None - encoding = 'utf-16le' + encoding = 'utf-16' + output_encoding = 'utf-16le' class AbstractParam: __metaclass__ = ABCMeta - encoding = 'utf-16le' + encoding = 'utf-16' def __init__(self): self.param_list = [] @@ -333,7 +334,8 @@ class GptTmplInfParser(GPParser): def write_binary(self, filename): with codecs.open(filename, 'wb+', - self.encoding) as f: + self.output_encoding) as f: + f.write(u'\ufeff') for s in self.sections: self.sections[s].write_section(s, f) -- 2.17.1