Created attachment 299725 [details]
patch to add support for copy/paste utf8 to/from X PRIMARY/CLIPBOARD
$ echo $LANG
$ vi -u NONE
:call setreg('*','Hello Привет PRIMARY')
This will copy text to Xorg PRIMARY selection, but Russian will be broken.
Copying Russian between xterm, pidgin and opera works ok on my system, and
only Vim is damaging Russian both when copy and paste to pidgin and opera.
Pasting with middle button in xterm output Russian correctly.
But when I paste (using middle mouse button) this text to GUI applications
I got this:
Pidgin: Hello PRIMARY
Opera: Hello $(B'1'b'Z'S'V'd.(B PRIMARY
The xsel tool output Russian correctly, but print warning:
$ xsel -v -o -p
xsel: Conversion refused
Hello Привет PRIMARY
Exactly same issue apply to copying to register '+' and to paste from both
This happens because Vim doesn't support UTF8_STRING X Atom type for clipboard contents. I've create patch (attached) which add this support. It works for me (tested on vim-7.3.266 and vim-7.3.409), and was sent upstream.
To use it add into .ebuild:
This appears to be fixed in recent versions.