From c17015d10a460427bb3516c9b24b582c2df0b322 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 9 Mar 2012 10:51:48 +0100 Subject: [PATCH] mshtml: Recognize UTF-8 BOM. --- dlls/mshtml/navigate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 69329c45751..d3070b01d9f 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); #define CONTENT_LENGTH "Content-Length" +#define UTF8_STR "utf-8" #define UTF16_STR "utf-16" static const WCHAR emptyW[] = {0}; @@ -1092,6 +1093,11 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream) && (BYTE)This->nsstream->buf[0] == 0xff && (BYTE)This->nsstream->buf[1] == 0xfe) This->nschannel->charset = heap_strdupA(UTF16_STR); + if(This->nsstream->buf_size >= 3 + && (BYTE)This->nsstream->buf[0] == 0xef + && (BYTE)This->nsstream->buf[1] == 0xbb + && (BYTE)This->nsstream->buf[2] == 0xbf) + This->nschannel->charset = heap_strdupA(UTF8_STR); if(!This->nschannel->content_type) { WCHAR *mime; -- 2.11.4.GIT