Skip to content

Commit

Permalink
fix unicode null handling
Browse files Browse the repository at this point in the history
  • Loading branch information
markreidvfx committed Apr 26, 2019
1 parent 49be156 commit 37de8c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aaf2/mxf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def decode_strong_ref_array(data):


def decode_utf16be(data):
return data.decode('utf-16be').rstrip('\x00')
return data.decode('utf-16be').split(u'\x00')[0]

def decode_auid(data):
return AUID(bytes_be=data)
Expand Down
2 changes: 1 addition & 1 deletion aaf2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def read_filetime(f):
return read_u64le(f)

def decode_utf16le(data):
return data.decode('utf-16le').rstrip('\x00')
return data.decode('utf-16le').split(u'\x00')[0]

def encode_utf16le(data):
return data.encode("utf-16le") + b"\x00\x00"
Expand Down

0 comments on commit 37de8c1

Please sign in to comment.