Update reader.py

This commit is contained in:
Vedant Ravindra Dhoke 2025-07-13 21:30:43 -04:00 committed by GitHub
parent a567845b10
commit 7a31a1f32f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,7 +40,7 @@ from .types import Callback, SimpleContextManager, KeySpec, CommandName
# syntax classes
SYNTAX_WHITESPACE, SYNTAX_WORD, SYNTAX_SYMBOL = range(3)
def normalize_surrogates(s):
def normalize_surrogates(s: str) -> str:
# Encode with surrogatepass, decode to normalize surrogate pairs
try:
return s.encode('utf-16', 'surrogatepass').decode('utf-16')