Jacek Caban (@jacek) commented about dlls/mshtml/xmlhttprequest.c:
+ } + + nsAString_InitDepend(&nsstr, NULL); + nsres = nsIXMLHttpRequest_GetResponseText(This->nsxhr, &nsstr); + if(NS_SUCCEEDED(nsres)) { + const PRUnichar *data; + char text[256 * 3]; + unsigned len; + WCHAR *mime; + + nsAString_GetData(&nsstr, &data); + len = WideCharToMultiByte(CP_ACP, 0, data, wcsnlen(data, 256), text, ARRAY_SIZE(text), NULL, NULL); + nsAString_Finish(&nsstr); + + if(len) { + hres = FindMimeFromData(NULL, NULL, text, len, NULL, 0, &mime, 0); This looks like a hack. urlmon already does that earlier, using the right encoding and response headers as a hint and that's what's propagated to Gecko. Can we use that here somehow?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8960#note_115751