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: ...@@ -337,19 +337,15 @@ cdef class RFBClient:
def send_client_cut_text(self, unicode text): def send_client_cut_text(self, unicode text):
cdef int result, strlen cdef int result, strlen
cdef bytes text_latin1 cdef bytes encoded_text
cdef char *string cdef char *string
if not self.connected: if not self.connected:
return return
try: encoded_text = text.encode('latin1', errors='replace')
text_latin1 = text.encode('latin1') string = encoded_text
except UnicodeEncodeError: strlen = len(encoded_text)
return
string = text_latin1
strlen = len(text_latin1)
with nogil: with nogil:
result = SendClientCutText(self.client, string, strlen) 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