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

743Win32 clipboard and pasting unicode from other apps

Expand Messages
  • Beck, Zak
    Nov 14, 2002
    • 0 Attachment

      I think I know why gvim on Win32 breaks unicode cut/copy and pasting from
      other apps, but I don't know enough (yet) about the vim internals and
      especially multibyte to fix it.

      I used ClipSpy from http://home.inreach.com/mdunn/ and copied from a
      Japanese MS Word document to see exactly what was put on the clipboard. The
      text was put on the clipboard in two formats: CF_TEXT, which produced a
      series of '?' characters (0x3F), which was presumably because the japanese
      characters do not exist in ANSI. However, the correct text was put on the
      clipboard in the CF_UNICODETEXT format, which is presumably UTF-8.

      The problem is in os_mswin.c, the function clip_mch_request_selection (line
      755) only requests the CF_TEXT format from the clipboard. I would imagine
      the best way around this would be to modify this function so that it uses
      the CF_UNICODETEXT format in preference to the CF_TEXT format if set
      encoding is a multibyte format.

      My problems are:

      1. I don't know how to determine whether or not I want the CF_TEXT format or
      the CF_UNICODETEXT. Presumably I look at the value of encoding and determine
      it somehow from that? Is there a function to do this?

      2. I don't know what to do with the CF_UNICODETEXT once I've retrieved it
      from the clipboard! Will it need converting to another format? Possibly the
      code in that function will work as is, I don't know enough about the

      Anyway, if this helps anyone or if anyone can help me, please let me know!

      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.
    • Show all 32 messages in this topic