Since this may be my fault (or Chrome's fault) I won't go into deep
details. Instead, I'll show a small example.
I select and copy in Google Chrome (using Ctrl-C) the word "Raúl"
(that is, my name). I open any program and paste, and the text pasted
is exactly "Raúl".
Now I open console Vim under gnome-terminal and I run ":registers".
This is what I have (excerpted):
"* Raúl
"+ Raúl
In the first line the text is correct, but in the second line the
uacute doesn't appear and instead you can see the latin-1
representation.
Any other program I've tested works perfectly when pasting text from
Google Chrome, and Vim works perfectly when pasting text from other
programs, so the problem looks like a weird interaction between Google
Chrome and Vim, or just with the way Google Chrome uses the clipboard
selection.
Anyone knows which can be the problem?
Thanks in advance, guys!
--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
:.!iconv -f utf-8 -t ISO-8859-1
I have no idea why this is, but this is at least a usable workaround.
I'd like to know more about this.
I've noticed what seems to be a related issue: If you _select_ (not
copy) your name in Chrome, and then go to a console and type
xclip -o
the ú will be garbled.
A bit more detail:
$ xclip -o | xxd
0000000: 5261 fa6c Ra.l
It looks like the opposite is happening here, ie it is being converted
from UTF-8 into ISO-8859-1:
$ xclip -o | iconv -f ISO-8859-1 -t utf-8 | xxd
0000000: 5261 c3ba 6c Ra..l
$ echo -n "Raúl" | xxd
0000000: 5261 c3ba 6c Ra..l
Both of these are the correct UTF-8 rendering of your name.
On Mar 31, 4:54 pm, Raúl Núñez de Arenas Coronado <raul...@gmail.com>
wrote:
> Hi Raúl,
> I've been having the same problem. Somewhere along the line the
> copied text is getting converted from ISO-8859-1 to utf-8. This
> causes problems because it's actually already in UTF-8. So to convert
> the current line back you can do
>
> :.!iconv -f utf-8 -t ISO-8859-1
>
> I have no idea why this is, but this is at least a usable workaround.
> I'd like to know more about this.
>
> I've noticed what seems to be a related issue: If you _select_ (not
> copy) your name in Chrome, and then go to a console and type
> xclip -o
> the ú will be garbled.
FWIW, this appears to work fine for me (both selection and
copying-to-clipboard) with Chromium 4.0.266.0 (Developer Build 33995).
Chromium still seems to be in very volatile development. (I didn't
realize there was even a 'real' Chrome for Linux, though.) It wouldn't
surprise me if this simply 'fixes itself' in some future Chrome release.
--
Best,
Ben
Ted <c...@gmail.com> skribis:
> Hi Raúl, I've been having the same problem. Somewhere along the line
> the copied text is getting converted from ISO-8859-1 to utf-8.
Or viceversa, maybe. Look what I'm getting after selecting and copying
my name:
~$ xclip -o -selection clipboard | od -tx1
0000000 52 61 c3 ba 6c
0000005
~$ xclip -o -selection primary | od -tx1
0000000 52 61 fa 6c
0000004
The clipboard selection (XA_CLIPBOARD) is encoded using utf-8,
correctly, and that's why using "* works for me. But the primary
selection (XA_PRIMARY) is converted to latin1, don't know why.
In short, Google Chrome fault, I'll report the bug.
> This causes problems because it's actually already in UTF-8. So to
> convert the current line back you can do
>
> :.!iconv -f utf-8 -t ISO-8859-1
>
> I have no idea why this is, but this is at least a usable workaround.
> I'd like to know more about this.
Thanks, I'll use this as an interim solution :)
> I've noticed what seems to be a related issue: If you _select_ (not
> copy) your name in Chrome, and then go to a console and type
> xclip -o
> the ú will be garbled.
Of course, because then the XA_PRIMARY selection is used, and that's is
garbled.
If the problem is solved I'll post a note here. I was investigating this
issue because I want to write a Chrome extension so Vim can be used to
edit text boxes.
On Thu, Apr 1, 2010 at 05:38, Benjamin R. Haskell <v...@benizi.com> wrote:
> FWIW, this appears to work fine for me (both selection and
> copying-to-clipboard) with Chromium 4.0.266.0 (Developer Build 33995).
I'm using 5.0.360.5 dev, but it didn't work either with latest stable release.
> Chromium still seems to be in very volatile development. (I didn't
> realize there was even a 'real' Chrome for Linux, though.)
It has been around for some time, but it didn't work very well. I
discovered a .deb package some days ago and I decided to test it,
specially regarding Vim interaction!
> It wouldn't surprise me if this simply 'fixes itself' in some future Chrome release.
Probably. The bug got introduced after your version and before mine.
Probably it is already fixed in some development branch.
Thanks :)