tool/create_packet_log: try to deal with windows 16-bit unicode by dropping \0 characters

This commit is contained in:
Matthias Ringwald 2020-08-26 17:08:12 +02:00
parent 29f287b5e3
commit e698d63d6c

View File

@ -107,11 +107,13 @@ with open (outfile, 'wb') as fout:
line_conter = 0
for line in fin:
try:
# try to deal with windows 16-bit unicode by dropping \0 characters
line = ''.join([c for c in line if c != '\0'])
line_conter += 1
timestamp = None
# strip newlines
line = line.strip("\n\r")
# skip empyt lines
# skip empty lines
if len(line) == 0:
continue
parts = re.match('\[(.*)\] (.*)', line)