[ 
https://issues.apache.org/jira/browse/GUACAMOLE-786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16829963#comment-16829963
 ] 

Michael Jumper commented on GUACAMOLE-786:
------------------------------------------

{quote}
If I leave the default encoding, then :

a) copying from local machine to VNC remote session works. I  can send over 
"François" and paste it in the VNC session.
b) copying from the vnc session back to the local machine doesn't work. I get 
back RnJhbsODwqdvaXM= which cannot be decoded back to "François"
{quote}

First, use a {{Guacamole.StringReader}}. You don't need to manually decode each 
blob like that.

Second, that value decodes to "François". "ç" is U+00C3 and U+00A7, the 
result of taking the UTF-8 for "ç" (0xC3 0xA7) and incorrectly re-encoding each 
byte as individual Unicode codepoints. Something is wrong with whatever you are 
using on the VNC side - either the VNC server is incorrectly encoding the 
clipboard values, or an application within the VNC session is incorrectly 
setting the clipboard.

This is what would be expected if a part of a system is expecting ISO 8859-1 
but is instead being fed UTF-8.

{quote}
if I switch to UTF-8 (config.setParameter("clipboard-encoding", "UTF-8");) :

I see the warning in the guacd daemon so it is sent properly

a) copying from local to VNC session is NOT ok. When I paste in VNC I get 
"François" instead of "François". 
{quote}

Yes, for the same reason that you see the warning in guacd. You can only use 
that setting if you know for absolute certain that the VNC server is going to 
accept UTF-8 as its clipboard encoding, despite the VNC standard requiring 
otherwise. Your VNC server is not handling the clipboard as UTF-8. What you are 
seeing there is the result of decoding the UTF-8 bytes as if they were ISO 
8859-1.

{quote}
b) copying from the VNC session back to local works. I get RnJhbsOnb2lz which I 
can decode back to "François"
{quote}

In reality, it isn't. Two incorrect encodings happen to be aligning such that 
you are getting what you expect.

{quote}
Any idea what the issue could be?
{quote}

You need to use the encoding that the VNC server is actually using. In this 
case, that would seem to be ISO 8859-1.

If you have any further questions on this, please use the mailing list. JIRA is 
a bug/issue tracker and isn't the place for addressing questions.

> VNC clipboard + encoding 
> -------------------------
>
>                 Key: GUACAMOLE-786
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-786
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole-server
>    Affects Versions: 1.0.0
>            Reporter: Francois Reynaud
>            Priority: Minor
>
> I cannot get the clipboard to work both ways for VNC ( x11vnc) using guacd + 
> common-js client + java ConfiguredGuacamoleSocket 
> If I leave the default encoding, then :
> a) copying from local machine to VNC remote session works. I  can send over 
> "François" and paste it in the VNC session.
> b) copying from the vnc session back to the local machine doesn't work. I get 
> back RnJhbsODwqdvaXM= which cannot be decoded back to "François"
>  
> if I switch to UTF-8 (config.setParameter("clipboard-encoding", "UTF-8");) :
> I see the warning in the guacd daemon so it is sent properly
> a) copying from local to VNC session is NOT ok. When I paste in VNC I get 
> "François" instead of "François". 
> b) copying from the VNC session back to local works. I get RnJhbsOnb2lz which 
> I can decode back to "François"
>  
> Any idea what the issue could be ?
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to