Friday, August 27, 2010

Re: More information about the strange clipboard behaviour

On 23/08/10 14:58, Raúl Núñez de Arenas Coronado wrote:
> Hi all :)
>
> A time ago I posted a message about a problem I was having with the
> clipboard and Vim 7.2. After updating to 7.3 I checked to see if the
> problem had vanished.
> I'm using console-only Vim 7.3-3, self compiled, under Ubuntu Linux
> 10.04 with X Window System.
>
> Here is how I reproduce it:
> - I selected and copied the text "David Gómez" from a GMail message
> shown in Google Chrome. The problem only happens with that
> combination, Google Chrome and Vim.
> - From a terminal:
> $ xclip -selection primary -o | od -Ax -tx1
> 000000 44 61 76 69 64 20 47 c3 b3 6d 65 7a
> 00000c
> $ xclip -selection clipboard -o | od -Ax -tx1
> 000000 44 61 76 69 64 20 47 c3 b3 6d 65 7a
> 00000c
>
> As you can see, both the primary and the clipboard selections have the
> same text, the UTF-8 representation of "David Gómez".
>
> Now, I paste the text into an empty "vim -u NONE", using "+po<ESC>"*p
> and the screen shows this:
> David Gómez
> David Gómez
> ~
> ~
> ...
>
> As you can see the first text is pasted incorrectly, the second,
> correctly. Here is the output of ":registers"
>
> --- Registers ---
> "* David Gómez
> "+ David Gómez
>
> Again, it is shown that the "+" register is coded incorrectly.
>
> After this, I tried to paste the default clipboard (that is, the one
> that gets pasted usually with Ctrl-V) in many different applications
> without any problem.
> As shown by "xclip", both selections have exactly the same text, the
> same bytes, but Vim is treating them differently.
>
> Probably the problem is a Google Chrome one, but since only Vim shows
> this behaviour I don't know what to think. If somebody could give me
> another example of this problem (or reproduce it) I would be happy to
> report the problem to the Google people.
>
> Thanks!!
>

Well, apparently Vim interprets the clipboard contents as Latin1 and the
primary selection as UTF-8. Not sure why.

- What is your system locale? (Warning: it may be different in a program
such as Chrome, launched from a desktop icon, and in console Vim,
launched by bash. Try running ":language" in gvim started with -u NONE
from Alt-F2 or from the "Run Application..." popup).

- What happens if instead of Chrome you use Firefox or Konqueror or...?

- What happens if instead of Console Vim you use gvim?


Best regards,
Tony.
--
This message contains 78% recycled characters.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: