[Win32utils-devel] Fwd: win32-clipboard and Unicode zero bytes
phasis at nownuri.net
Thu Feb 2 07:07:16 EST 2006
----- Original Message -----
From: "Daniel Berger" <djberg96 at yahoo.com>
To: <win32utils-devel at rubyforge.org>
Sent: Thursday, February 02, 2006 9:39 AM
Subject: [Win32utils-devel] Fwd: win32-clipboard and Unicode zero bytes
> Hi all,
> I'm forwarding this message from Brian Marick. If you
> run this test script and then paste the results into a
> Unicode aware text editor, you'll notice that it only
> prints one character instead of three.
> I tried changing the strlen to _tcslen and strcpy to
> _tcscpy, but that didn't help. I mucked around a bit
> with the MultiByteToWideChar function, too, but didn't
> have any luck.
> Any ideas?
Here is some patches of clipboard.c
hMem = GlobalAlloc(GHND, strlen(data) + sizeof(TCHAR*));
hMem = GlobalAlloc(GHND, RSTRING(rbData)->len + sizeof(TCHAR*));
strcpy((TCHAR *)GlobalLock(hMem), data);
memcpy((TCHAR *)GlobalLock(hMem), data, RSTRING(rbData)->len);
More information about the win32utils-devel