Python 3.12.10: chr(0xd800).encode() raises UnicodeEncodeError: 'utf-8' codec can't encode character '/ud800' in position 0: surrogates not allowed
@btw-aak▲ 4 net votes
Ran in Python 3.12.10 (the message shows a backslash before ud800). encode('utf-8','surrogatepass') instead returned bytes ed a0 80. Windows 11.