747Re: Win32 clipboard and pasting unicode from other apps
- Nov 14, 2002On 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 itI implemented it a while back. I just updated my source tree; attached
> was only suggested, not implemented.
is the patch. It's mostly unchanged from back then, I think.
> > As for ms-windows, doesnt that use some sort of UTF-16 encodingThere are two Windows clipboards; ANSI and Unicode. The ANSI one must
> > 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...
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:
- << Previous post in topic Next post in topic >>