Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
42d98d2a
Commit
42d98d2a
authored
Nov 23, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use codepage reported by http headers.
parent
3a3daead
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
1 deletion
+71
-1
navigate.c
dlls/mshtml/navigate.c
+71
-1
No files found.
dlls/mshtml/navigate.c
View file @
42d98d2a
...
...
@@ -626,6 +626,57 @@ static void call_docview_84(HTMLDocumentObj *doc)
FIXME
(
"handle result
\n
"
);
}
static
void
parse_content_type
(
nsChannelBSC
*
This
,
const
WCHAR
*
value
)
{
const
WCHAR
*
ptr
;
size_t
len
;
static
const
WCHAR
charsetW
[]
=
{
'c'
,
'h'
,
'a'
,
'r'
,
's'
,
'e'
,
't'
,
'='
};
ptr
=
strchrW
(
value
,
';'
);
if
(
!
ptr
)
return
;
ptr
++
;
while
(
*
ptr
&&
isspaceW
(
*
ptr
))
ptr
++
;
len
=
strlenW
(
value
);
if
(
ptr
+
sizeof
(
charsetW
)
/
sizeof
(
WCHAR
)
<
value
+
len
&&
!
memicmpW
(
ptr
,
charsetW
,
sizeof
(
charsetW
)
/
sizeof
(
WCHAR
)))
{
size_t
charset_len
,
lena
;
nsACString
charset_str
;
const
WCHAR
*
charset
;
char
*
charseta
;
ptr
+=
sizeof
(
charsetW
)
/
sizeof
(
WCHAR
);
if
(
*
ptr
==
'\''
)
{
FIXME
(
"Quoted value
\n
"
);
return
;
}
else
{
charset
=
ptr
;
while
(
*
ptr
&&
*
ptr
!=
','
)
ptr
++
;
charset_len
=
ptr
-
charset
;
}
lena
=
WideCharToMultiByte
(
CP_ACP
,
0
,
charset
,
charset_len
,
NULL
,
0
,
NULL
,
NULL
);
charseta
=
heap_alloc
(
lena
+
1
);
if
(
!
charseta
)
return
;
WideCharToMultiByte
(
CP_ACP
,
0
,
charset
,
charset_len
,
charseta
,
lena
,
NULL
,
NULL
);
charseta
[
lena
]
=
0
;
nsACString_InitDepend
(
&
charset_str
,
charseta
);
nsIHttpChannel_SetContentCharset
(
&
This
->
nschannel
->
nsIHttpChannel_iface
,
&
charset_str
);
nsACString_Finish
(
&
charset_str
);
heap_free
(
charseta
);
}
else
{
FIXME
(
"unhandled: %s
\n
"
,
debugstr_wn
(
ptr
,
len
-
(
ptr
-
value
)));
}
}
static
HRESULT
parse_headers
(
const
WCHAR
*
headers
,
struct
list
*
headers_list
)
{
const
WCHAR
*
header
,
*
header_end
,
*
colon
,
*
value
;
...
...
@@ -659,6 +710,25 @@ static HRESULT parse_headers(const WCHAR *headers, struct list *headers_list)
return
S_OK
;
}
static
HRESULT
process_response_headers
(
nsChannelBSC
*
This
,
const
WCHAR
*
headers
)
{
http_header_t
*
iter
;
HRESULT
hres
;
static
const
WCHAR
content_typeW
[]
=
{
'c'
,
'o'
,
'n'
,
't'
,
'e'
,
'n'
,
't'
,
'-'
,
't'
,
'y'
,
'p'
,
'e'
,
0
};
hres
=
parse_headers
(
headers
,
&
This
->
nschannel
->
response_headers
);
if
(
FAILED
(
hres
))
return
hres
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
This
->
nschannel
->
response_headers
,
http_header_t
,
entry
)
{
if
(
!
strcmpiW
(
iter
->
header
,
content_typeW
))
parse_content_type
(
This
,
iter
->
data
);
}
return
S_OK
;
}
HRESULT
start_binding
(
HTMLWindow
*
window
,
HTMLDocumentNode
*
doc
,
BSCallback
*
bscallback
,
IBindCtx
*
bctx
)
{
IStream
*
str
=
NULL
;
...
...
@@ -1471,7 +1541,7 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code,
headers
=
strchrW
(
response_headers
,
'\r'
);
if
(
headers
&&
headers
[
1
]
==
'\n'
)
{
headers
+=
2
;
hres
=
p
arse_headers
(
headers
,
&
This
->
nschannel
->
response_
headers
);
hres
=
p
rocess_response_headers
(
This
,
headers
);
if
(
FAILED
(
hres
))
{
WARN
(
"parsing headers failed: %08x
\n
"
,
hres
);
return
hres
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment