Commit b0bb2e72 authored by Dan Pascu's avatar Dan Pascu

Be permissive in cut text latin1 encoding

parent a698f4ac
......@@ -337,19 +337,15 @@ cdef class RFBClient:
def send_client_cut_text(self, unicode text):
cdef int result, strlen
cdef bytes text_latin1
cdef bytes encoded_text
cdef char *string
if not self.connected:
return
try:
text_latin1 = text.encode('latin1')
except UnicodeEncodeError:
return
string = text_latin1
strlen = len(text_latin1)
encoded_text = text.encode('latin1', errors='replace')
string = encoded_text
strlen = len(encoded_text)
with nogil:
result = SendClientCutText(self.client, string, strlen)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment