diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c index 41b6d9cbc..6cf4f91c2 100644 --- a/hw/xwin/winclipboard/xevents.c +++ b/hw/xwin/winclipboard/xevents.c @@ -200,7 +200,6 @@ winClipboardSelectionNotifyData(HWND hwnd, xcb_window_t iWindow, xcb_connection_ BOOL fSetClipboardData = TRUE; char *pszReturnData = NULL; - UINT codepage; wchar_t *pwszUnicodeStr = NULL; HGLOBAL hGlobal = NULL; char *pszGlobalData = NULL; @@ -275,6 +274,8 @@ winClipboardSelectionNotifyData(HWND hwnd, xcb_window_t iWindow, xcb_connection_ xtpText_nitems = nitems; } + UINT codepage = CP_ACP; + if (xtpText_encoding == atoms->atomUTF8String) { pszReturnData = calloc(1, xtpText_nitems + 1); memcpy(pszReturnData, xtpText_value, xtpText_nitems); @@ -412,7 +413,6 @@ winClipboardFlushXEvents(HWND hwnd, { char *xtpText_value = NULL; int xtpText_nitems; - UINT codepage; xcb_selection_request_event_t *selection_request = (xcb_selection_request_event_t *)event; { @@ -535,6 +535,8 @@ winClipboardFlushXEvents(HWND hwnd, } pszGlobalData = (char *) GlobalLock(hGlobal); + UINT codepage = CP_ACP; + /* Convert to target string style */ if (selection_request->target == XCB_ATOM_STRING) { codepage = CP_ISO_8559_1; // code page identifier for iso-8559-1