mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-31 10:19:48 +03:00
Update within_surrogate function
within_surrogate()'s second condition doesn't check for previous surrogate pair being the first (high surrogate) of the pair so it spans over all consecutive surrogates From https://t.me/TelethonChat/586037 Co-authored-by: Disk6969 <disk6969@users.noreply.github.com>
This commit is contained in:
parent
6187ff7dcb
commit
c72e63cf1d
|
@ -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
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user