Jacek Caban (@jacek) commented about dlls/mshtml/nsio.c:
len = MultiByteToWideChar(CP_UTF8, 0, aOriginCharset, -1, NULL, 0); charset = SysAllocStringLen(NULL, len-1);
if(!charset)
if(!charset) {
if(base_wine_uri)
nsIFileURL_Release(&base_wine_uri->nsIFileURL_iface);
You could just move querying for nsWineURI below origin charset handling instead.