Skip to content

Commit

Permalink
Merge 2d50ef8 into 4b16870
Browse files Browse the repository at this point in the history
  • Loading branch information
rossengeorgiev committed Jul 24, 2019
2 parents 4b16870 + 2d50ef8 commit ffb60d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ def read_string(s, idx, wide=False):
raise SyntaxError("Unterminated cstring, index: %d" % idx)
result = s[idx:end]
if wide:
result = result.decode('utf-16')
result = result.decode('utf-16', 'replace')
elif bytes is not str:
result = result.decode('utf-8')
result = result.decode('utf-8', 'replace')
else:
try:
result.decode('ascii')
except:
result = result.decode('utf-8')
result = result.decode('utf-8', 'replace')
return result, end + (2 if wide else 1)

stack = [mapper()]
Expand Down

0 comments on commit ffb60d0

Please sign in to comment.