SungHyun Nam wrote:

> Yuriy Kaminskiy wrote:
> > SungHyun Nam wrote:
> >> 2010-09-23 AM 12:49, Young Ho Park wrote:
> >>> Hello. I am a Vim user from South Korea. I seem to find the bug about
> >>> cut(or copy) and paste. Let me explain steps to a paste fail.
> >>>
> >>> I use Vim7.2 in Gnome2.3 of Fedora13 or Ubuntu10.04 and my locale is
> >>> ko_KR.utf8 0. I executed Vim. 1. I wrote Alphabet and Hangul mixed
> >>> string. 2. I clicked a copy(or cut) button. 3. I closed Vim. 4. I
> >>> executed Vim again. 5. I clicked a paste button. 6. English
> >>> characters were well copied. But Hangul characters are changed to
> >>> question marks like: =BF?=BF?=BF?=BF?
> >>>
> >>> Is it a bug? Or didn't I turn on some options?
> >>
> >> More info about this problem.
> >>
> >> 1.  If I don't quit select&copied-gvim, then paste to
> >>      gnome-terminal or other-gvim works fine.
> >>
> >> 2.  If I quit select&copied-gvim:
> >>      o   paste menu in gnome-terminal became disabled (and nothing
> >>          happened if I click middle mouse button).
> >>      o   when I paste in other-gvim, hangul characters are now
> >>          corrupted.
> >
> > I think this was introduced in 7.2.221 patch, that tries a bit
> > too much to follow standard on CUTBUFFER* encoding, rendering it
> > useless for any non-latin1 locales.
> 
> I revert 7.2.221 patch [*1*] and the corrupt problem gone.
> 
> With a reverted gvim-gtk2,
> 
> 1.  If I don't quit select&copied-gvim, then paste to
>       gnome-terminal or other-gvim works fine.
> 
> 2.  If I quit select&copied-gvim:
>       o   paste menu in gnome-terminal became disabled (and nothing
>           happened if I click middle mouse button).
>       *   PASTE IN OTHER-GVIM WORKS FINE (NO CORRUPTION).

The cut buffer is a very old mechanism and should not be used for any
modern program.  See http://www.jwz.org/doc/x-cut-and-paste.html They
are still provided for compatibility with old programs, and these are
expected to only use latin1.

The problem is that when Vim exits the contents of the selection and
clipboard are lost.  The text is put in the cut buffer as a last resort.
Not only does this drop the encoding, also other properties are lost
(e.g. blockwise selection).

One could think of a hack, such as a magic string at the start of the
buffer that encodes the meta data.  But the result is that pasting in
another application produces a mess.

The only good solution is to not exit Vim.  Or use some kind of
clipboard manager that consumes the text and mimics Vim when it has
exited.

-- 
Don't be humble ... you're not that great.
                      -- Golda Meir

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui