From 63d9b267f4d1906ab8a913e367db34b70700a7a7 Mon Sep 17 00:00:00 2001 From: Prashant Sengar <45726744+prashantsengar@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:12:13 +0530 Subject: [PATCH] Fix unparsing of message.text (#4301) Co-authored-by: Disk6969 --- telethon/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/helpers.py b/telethon/helpers.py index 4fb9d58b..f4abe296 100644 --- a/telethon/helpers.py +++ b/telethon/helpers.py @@ -58,7 +58,7 @@ def within_surrogate(text, index, *, length=None): return ( 1 < index < len(text) and # in bounds - '\ud800' <= text[index - 1] <= '\udfff' and # previous is + '\ud800' <= text[index - 1] <= '\udbff' and # previous is '\ud800' <= text[index] <= '\udfff' # current is )