Saturday, August 28, 2010

Re: More information about the strange clipboard behaviour

On Sat, Aug 28, 2010 at 04:24:34AM +0200, Tony Mechelynck wrote:
> 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.
> >
> > 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
> > ~
>
> 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?
>

I have the same issue with vim on xterm when copying text from opera. After
copied some Chinese string from opera, say,

氢氧化钠

In vim, "*p and "+p give the weired result:

"' 
"' 

But shift-insert can paste it correctly. I've tried emacs, emacs can paste it
correcly too.

My local is en_US.UTF-8, vim's 'encoding' option is utf-8.

My OS: FreeBSD fbsd.t60.cpu 8.1-STABLE FreeBSD 8.1-STABLE #0: Fri Aug 27
20:10:55 CST 2010 root@fbsd.t60.cpu:/usr/obj/usr/src/sys/T60 i386

My vim:
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Aug 24 2010 00:37:11)
Included patches: 1-6, 8-35, 37-48, 50-70, 73, 75-87, 90-92, 94-100, 102-137, 139-149, 151
-171, 173-190, 192-193, 195-203, 206-211, 213-215, 217-218, 220-232, 234-246, 251-259, 261
-301, 303-319, 321-322, 324-335, 337-351, 353-361, 363, 366-371, 373, 375-376, 378-383, 38
5-387, 389-398, 401-402, 404-411
Compiled by root@fbsd.t60.cpu
Big version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv
+cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra
+extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork()
-gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall
+linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse
-mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra
-perl +postscript +printer -profile -python +quickfix +reltime +rightleft -ruby
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects
+title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 +xfontset -xim +xsmp_interact
+xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -O2 -pipe -march=pr
escott -fno-strict-aliasing -march=prescott -D_FORTIFY_SOURCE=1
Linking: cc -L/usr/local/lib -o vim -lXt -lm -ltermlib -liconv

--
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China

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