Message232188
# http://stackoverflow.com/a/25678113/819417
def copy(data):
if not isinstance(data, unicode):
data = data.decode('mbcs')
OpenClipboard(None)
EmptyClipboard()
hCd = GlobalAlloc(GMEM_DDESHARE, 2 * (len(data) + 1))
pchData = GlobalLock(hCd)
wcscpy(ctypes.c_wchar_p(pchData), data)
GlobalUnlock(hCd)
SetClipboardData(CF_UNICODETEXT, hCd)
CloseClipboard()
Emoji "📋" (\U0001f400) is copied as "🐀" (\U0001f4cb), or "📋." turns to "📋" (note the period).
It works fine in Python 3.2.5. |
|
Date |
User |
Action |
Args |
2014-12-05 09:58:05 | Cees.Timmerman | set | recipients:
+ Cees.Timmerman, vstinner, ezio.melotti |
2014-12-05 09:58:05 | Cees.Timmerman | set | messageid: <1417773485.83.0.226794721808.issue22999@psf.upfronthosting.co.za> |
2014-12-05 09:58:05 | Cees.Timmerman | link | issue22999 messages |
2014-12-05 09:58:05 | Cees.Timmerman | create | |
|