mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 12:34:43 +00:00
Rencode module now always loads strings as utf-8 encoded byte strings.
This commit is contained in:
parent
4f59a48f57
commit
6b5cf3396d
@ -159,12 +159,6 @@ def decode_string(x, f):
|
|||||||
raise ValueError
|
raise ValueError
|
||||||
colon += 1
|
colon += 1
|
||||||
s = x[colon:colon+n]
|
s = x[colon:colon+n]
|
||||||
try:
|
|
||||||
t = s.decode("utf8")
|
|
||||||
if len(t) != len(s):
|
|
||||||
s = t
|
|
||||||
except UnicodeDecodeError:
|
|
||||||
pass
|
|
||||||
return (s, colon+n)
|
return (s, colon+n)
|
||||||
|
|
||||||
def decode_list(x, f):
|
def decode_list(x, f):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user