diff options
author | Pierre Ossman <ossman@cendio.se> | 2019-05-10 11:44:19 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2019-07-01 11:18:27 +0200 |
commit | 5fbbe10b6c180ae8c0545695db6ad308cb5caea7 (patch) | |
tree | db83c70816ef00328e0da860a5b40522ce6435ae /common/rfb/CConnection.cxx | |
parent | 615d16bd5ba11e89262cc5cfe94a35b6d6e7a628 (diff) | |
download | tigervnc-5fbbe10b6c180ae8c0545695db6ad308cb5caea7.tar.gz tigervnc-5fbbe10b6c180ae8c0545695db6ad308cb5caea7.zip |
Use UTF-8 in clipboard API
In prepartion for better clipboard extensions that can send Unicode
data between the client and server.
Diffstat (limited to 'common/rfb/CConnection.cxx')
-rw-r--r-- | common/rfb/CConnection.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index ce2741e4..4e8ea4e5 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -470,7 +470,7 @@ void CConnection::serverCutText(const char* str) strFree(serverClipboard); serverClipboard = NULL; - serverClipboard = strDup(str); + serverClipboard = latin1ToUTF8(str); handleClipboardAnnounce(true); } @@ -516,7 +516,9 @@ void CConnection::announceClipboard(bool available) void CConnection::sendClipboardData(const char* data) { - writer()->writeClientCutText(data); + CharArray latin1(utf8ToLatin1(data)); + + writer()->writeClientCutText(latin1.buf); } void CConnection::refreshFramebuffer() |