bk138 / multivnc

MultiVNC is a cross-platform Multicast-enabled VNC viewer based on LibVNCClient. The desktop client runs on Unix, Mac OS X and Windows. There also is an Android client.
GNU General Public License v3.0
460 stars 66 forks source link

Android: Use ISO 8859-1 (Latin-1) encoding for clipboard synchronization #179

Closed gujjwal00 closed 2 years ago

gujjwal00 commented 2 years ago

RFB protocol requires Latin-1 encoding for clipboard text( ClientCutText, ServerCutText ). Right now we are using UTF-8. It works correctly for ASCII characters but fails for characters in range 0x80-oxFF.

You can try copying something like Fõõ Báŕ on the server. Debug version will crash due to UTF-8 validation by Android JNI layer.

I am doing encoding/decoding in Java because it gives us access to ISO 8859-1 Charset.

bk138 commented 2 years ago

yep,

12-11 20:17:05.273 32317 32317 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
12-11 20:17:05.273 32317 32317 F DEBUG   : Abort message: 'JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0xf5
12-11 20:17:05.273 32317 32317 F DEBUG   :     string: 'F�� B�\u0155'
12-11 20:17:05.273 32317 32317 F DEBUG   :     input: '0x46 0xf5 <0xf5> 0x20 0x42 0xe1 0x5c 0x75 0x30 0x31 0x35 0x35'
12-11 20:17:05.273 32317 32317 F DEBUG   :     in call to NewStringUTF
12-11 20:17:05.273 32317 32317 F DEBUG   :     from boolean com.coboltforge.dontmind.multivnc.VNCConn.rfbProcessServerMessage()'