Skip to content

Commit 9872a48

Browse files
committed
Fix (unexpected end of data) UnicodeDecodeError in Str
Fixes Mayuri-Chan/pyrofork#65
1 parent 55f1c3f commit 9872a48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyrogram/parser/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def add_surrogates(text):
3434

3535
def remove_surrogates(text):
3636
# Replace each surrogate pair with a SMP code point
37-
return text.encode("utf-16", "surrogatepass").decode("utf-16")
37+
return text.encode("utf-16", "surrogatepass").decode("utf-16", "ignore")
3838

3939

4040
def replace_once(source: str, old: str, new: str, start: int):

0 commit comments

Comments
 (0)