Skip to content

Commit a10a12c

Browse files
committed
Revert "Fix truncation of last character of VIN number by modifying decode_encoded_string function to use .replace() instead of .strip()"
This reverts commit 090b66a.
1 parent 05514fc commit a10a12c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

obd/decoders.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,7 @@ def decode_encoded_string(messages, length):
505505
# Encoded strings come in bundles of messages with leading null values to
506506
# pad out the string to the next full message size. We strip off the
507507
# leading null characters here and return the resulting string.
508-
decoded_string = d.strip().replace(b'\x00', b'').replace(b'\x01', b'').replace(b'\x02', b'').replace(b'\\x00', b'').replace(b'\\x01', b'').replace(b'\\x02', b'')
509-
return decoded_string
508+
return d.strip().strip(b'\x00' b'\x01' b'\x02' b'\\x00' b'\\x01' b'\\x02')
510509

511510

512511
def cvn(messages):

0 commit comments

Comments
 (0)