Thursday, May 9, 2013

Re: Copy and paste Spanish from google translate into vim?

Hi Dominique!

On Do, 09 Mai 2013, Dominique Pellé wrote:

> Copy/paste from Firefox into Vim does not work for me either for
> non ASCII characters if I use the middle click to paste in Vim (terminal)
> on Linux. It copies text, but messes up accents. I think that Vim puts
> a latin1 string and then interprets it as utf-8 so it looks messed up.
> Taking your example, if I copy/paste "síntoma" from Firefox with the
> mouse, I see in Vim (terminal) "s<ed>ntoma" . <ed> being in Latin1:
>
> 355 237 ED í LATIN SMALL LETTER I WITH ACUTE
>
> However, it works if I select the text in Firefox and drag it into the
> terminal. Copy/paste also work with middle click in gvim.
>
> I just realized now that copy paste actually works when I use
> "vim -u NONE". So by trial and error, I searched for the minimalistic
> .vimrc that can reproduce the problem. I can reproduce the
> copy/paste bug as follows:
>
> 1/ create a minimalistic ~/.vimrc file:
>
> $ cat ~/.vimrc
> set enc=utf8
> language eo.UTF-8
> set mouse=a
>
> 2/ Start vim with:
>
> $ vim --noplugin
>
> 3/ Copy a word with accents in Firefox such as "síntoma"
> and paste it in Vim (terminal) with middle click.
>
> 4/ Observe the bug Vim pastes: s<ed>ntoma
> Expected behavior was to paste "síntoma"
> Note also that dragging the selection from Firefox
> to Vim pastes correctly.
>
> Interestingly, bug happens with the "eo.UTF8" language
> but not with the "fr_FR.UTF8" language for example.
>
> You may need to install the eo.UTF8 locale in order to reproduce
> the bug with "sudo locale-gen eo.UTF8" as described here
> for Ubuntu:
>
> http://markushedlund.com/dev-tech/install-a-locale-on-ubuntu-11-10

Interesting. I don't see this behaviour here.

regards,
Christian
--
Mancher lehnt eine gute Idee bloß deshalb ab, weil sie nicht von ihm
ist.
-- Luis Bunuel

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: