[PATCH] Fix Unicode escape string occurring when calling GetClipboardData(CF_TEXT).

Dmitry Timoshkov dmitry at codeweavers.com
Mon May 3 03:45:47 CDT 2010


Sin-ta Hsiea <ibmibmibm.tw at gmail.com> wrote:

> Here's a patch that fetch UTF8 string, and convert to local codepage.

> +            count = WideCharToMultiByte(CP_OEMCP, 0, lpwstr, -1, NULL, 0, NULL, NULL);
> +            hText = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, count);
> +
> +            if (hText)
> +            {
> +                CHAR *text = GlobalLock(hText);
> +                WideCharToMultiByte(CP_OEMCP, 0, lpwstr, -1, text, -1, NULL, NULL);
> +                GlobalUnlock(hText);
> +            }

CP_OEMCP is not a local codepage.

-- 
Dmitry.



More information about the wine-devel mailing list