[v3 PATCH] winex11.drv: import X11's "text/html" as "HTML Format"
Alexandre Julliard
julliard at winehq.org
Wed Nov 16 16:46:56 CST 2016
Damjan Jovanovic <damjan.jov at gmail.com> writes:
> +static char *standardize_text_html( const char *data, size_t size )
> +{
> + char *textHtml = NULL;
> +
> + /* Firefox uses UTF-16LE with byte order mark. Convert to UTF-8 without the BOM. */
> + if (size >= 2 && ((BYTE*)data)[0] == 0xff && ((BYTE*)data)[1] == 0xfe)
> + {
> + INT textHtmlSize = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)&data[2], (size-2)/2, NULL, 0, NULL, NULL);
> + textHtml = HeapAlloc(GetProcessHeap(), 0, textHtmlSize);
> + if (textHtml)
> + WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)&data[2], (size-2)/2, textHtml, textHtmlSize, NULL, NULL);
> + else
> + ERR("out of memory\n");
> + }
> + return textHtml;
It seems to me that you should still import it even if it's not in
Firefox format.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list