mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-22 16:20:54 +00:00
tool/create_packet_log: try to deal with windows 16-bit unicode by dropping \0 characters
This commit is contained in:
parent
29f287b5e3
commit
e698d63d6c
@ -107,11 +107,13 @@ with open (outfile, 'wb') as fout:
|
|||||||
line_conter = 0
|
line_conter = 0
|
||||||
for line in fin:
|
for line in fin:
|
||||||
try:
|
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
|
line_conter += 1
|
||||||
timestamp = None
|
timestamp = None
|
||||||
# strip newlines
|
# strip newlines
|
||||||
line = line.strip("\n\r")
|
line = line.strip("\n\r")
|
||||||
# skip empyt lines
|
# skip empty lines
|
||||||
if len(line) == 0:
|
if len(line) == 0:
|
||||||
continue
|
continue
|
||||||
parts = re.match('\[(.*)\] (.*)', line)
|
parts = re.match('\[(.*)\] (.*)', line)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user