On 10/02/13 19:11, Dominique Pellé wrote:
ping <[email protected]> wrote:

I've copied and pasted an article from web page and it looks I got a lot of
following:

â<80><99>

so essentially it should be just a ' character, for example:

If youâ<80><99>ve

is there a way to get them displayed/processed well?

thanks!
regards
ping


I have the same problem.  When I copy paste text
from Firefox into Vim running in a terminal (xfce or
xterm at least), I get garbage for diacritics.  If I do
the same in GVim (gtk2), it works fine.

Yet my settings in GVim and Vim (terminal) are
identical:

:set encoding?
   encoding=utf-8

:set fileencoding?
   fileencoding=

:set fileencodings=?
   fileencodings=ucs-bom,utf-8,latin1

I'm not 100% sure, but I think it used to work fine
a long time ago.

Example to reproduce:

1) go to http://fr.wikipedia.org/wiki/Vim in Firefox

2) select with the mouse the first sentence in
     Firefox which says:
     "Vim est un éditeur de texte, c’est-à-dire un
     logiciel permettant la manipulation de fichiers texte."

3) Paste in Vim (terminal) using the mouse (middle
    click on Linux)

4) observe that it pastes:

    Vim est un <e9>diteur de texte, c\u2019est-<e0>-dire un logiciel
permettant la manipulation de fichiers texte.

5) Do the same with gvim (gtk2) and observe that
     there is no bug in Gvim

I also tried with the Chromium browser (same result).

The problem has to do with copy paste which loses
the character encoding I think and somehow makes
assumes the wrong encoding when pasting.

Typing Unicode characters works fine in terminal.
Copy paste from gvim into Vim (terminal) works fine.

I'm using vim-7.3.806 on xubuntu-12.10, Linux x86_64.

Dominique


With me it pastes correctly at step 2; however my system locale in bash (and therefore in the terminal) is en_US.UTF-8 (most specifically, LC_CTYPE is unset but LANG is set to that value), so the konsole terminal and Vim both know that strings are pasted in UTF-8. I also make sure that 'encoding' is UTF-8 in my vimrc, more or less as described in http://vim.wikia.com/wiki/Working_with_Unicode

Specifically, the line pasted in Console Vim is as follows:
Vim est un éditeur de texte, c’est-à-dire un logiciel permettant la manipulation de fichiers texte.

I'm using vim 7.3.806 (own-compiled from Bram's sources), Huge build running either in GUI or Console mode (for this test, as "vim" in a console terminal), running on openSUSE 12.1 x86_64. The Vim build is also 64-bit, as can be seen from the link log, where I get warning messages starting with "skipping incompatible" for 32-bit libraries in /usr/lib/


Best regards,
Tony.
--
Justice, n.:
        A decision in your favor.

--
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to