Wednesday, March 31, 2010

Re: Google Chrome under Linux and problems with "* and "+

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.

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 all :)
>
> 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!

--
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

To unsubscribe, reply using "remove me" as the subject.

No comments:

Post a Comment