Loading ...
Sorry, an error occurred while loading the content.

RE: Win32 clipboard and pasting unicode from other apps

Expand Messages
  • Beck, Zak
    Hi Glenn, I ve looked at your patch, it looks exactly like what I m looking for. I m going to try compiling with it today and I ll let you know my results.
    Message 1 of 32 , Nov 15, 2002
    • 0 Attachment
      Hi Glenn,

      I've looked at your patch, it looks exactly like what I'm looking for.

      I'm going to try compiling with it today and I'll let you know my results.

      Thanks

      Zak Beck
      Accenture HR Services (formerly e-peopleserve)
      Learning Management Systems
      Tel: 01785 762750
      email: mailto:zak.beck@...

      This electronic message contains information from e-peopleserve, which may
      be privileged and/or confidential. The information is intended to be for the
      use of the individual(s) or entity named above. If you are not the intended
      recipient, be aware that any disclosure, copying distribution or use of the
      contents of this information is prohibited. If you have received this
      electronic message in error, please notify us by telephone or e-mail (to the
      number or address above) immediately.


      -----Original Message-----
      From: Glenn Maynard [mailto:glenn@...]
      Sent: 14 November 2002 21:43
      To: vim-multibyte@...
      Subject: Re: Win32 clipboard and pasting unicode from other apps


      On Thu, Nov 14, 2002 at 10:18:02PM +0100, Bram Moolenaar wrote:
      > Sorry, my mistake. I can't seem to find a patch for Win32. Maybe it
      > was only suggested, not implemented.

      I implemented it a while back. I just updated my source tree; attached
      is the patch. It's mostly unchanged from back then, I think.

      > > As for ms-windows, doesnt that use some sort of UTF-16 encoding
      > > everywhere?
      > > I dont have any way to write windows code, so I cant help you with
      > > that...
      >
      > MS-Windows uses UCS-2, 16 bit Unicode charactes. The problem is that
      > the format stored on the (default) clipboard is not specified, thus we
      > must do a few tricks when using multiple encodings. Someone worked out
      > how it should work, but I can't find the reference right now...

      There are two Windows clipboards; ANSI and Unicode. The ANSI one must
      be ANSI codepage text, and the Unicode one in UCS-2.

      The attached patch attempts to put text in the Unicode clipboard, and if
      that fails (eg. we have no conversion path to Unicode), puts it in the
      ANSI clipboard. There's no need to duplicate the data in both, since
      Windows will convert it in the background (eg. if an app asks for CF_TEXT
      and only CF_UNICODETEXT is available, it'll be converted.)

      According to MS documentation, CF_UNICODETEXT is available all the way
      down to Win95:

      http://support.microsoft.com/default.aspx?scid=KB;en-us;q210341

      --
      Glenn Maynard
    • Bram Moolenaar
      ... That has a catch 42 problem: I would like to test the whole thing before sending the patch into the world. ... I didn t change the way it handles the
      Message 32 of 32 , Feb 6, 2003
      • 0 Attachment
        Glenn Maynard wrote:

        > > Can you check the changes for enc_codepage and send me a patch again?
        > > Preferably against the current version with the Unicode clipboard patch
        > > included.
        >
        > I'll run over it and send it again. It'd be easiest if you could commit
        > the clipboard patch to CVS, so I can diff from there.

        That has a catch 42 problem: I would like to test the whole thing before
        sending the patch into the world.

        > > I'm actually more worried about plain mistakes in the code. I did some
        > > cleaning up and could not test it all.
        >
        > I got it to apply (along with the strlen fix), and it's worked in a few
        > cursory tests (copying and pasting JP text with enc=utf-8 and enc=cp932).
        > I suspect you'll want more testing in 9x, which I can't do here ...

        I didn't change the way it handles the clipboard. It's mostly the
        various conversions that need to be checked, including iconv().

        --
        hundred-and-one symptoms of being an internet addict:
        156. You forget your friend's name but not her e-mail address.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      Your message has been successfully submitted and would be delivered to recipients shortly.