Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
58a261b7
Commit
58a261b7
authored
Apr 12, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Correctly handle utf-16 encoded pages.
parent
f44e289a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
14 deletions
+33
-14
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
navigate.c
dlls/mshtml/navigate.c
+17
-10
nsio.c
dlls/mshtml/nsio.c
+15
-4
No files found.
dlls/mshtml/mshtml_private.h
View file @
58a261b7
...
...
@@ -165,6 +165,7 @@ typedef struct {
nsLoadFlags
load_flags
;
nsIURI
*
original_uri
;
char
*
content
;
char
*
charset
;
}
nsChannel
;
typedef
struct
{
...
...
dlls/mshtml/navigate.c
View file @
58a261b7
...
...
@@ -37,6 +37,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
#define CONTENT_LENGTH "Content-Length"
#define UTF16_STR "utf-16"
#define NSINSTREAM(x) ((nsIInputStream*) &(x)->lpInputStreamVtbl)
...
...
@@ -399,31 +400,37 @@ static HRESULT WINAPI BindStatusCallback_OnDataAvailable(IBindStatusCallback *if
TRACE
(
"(%p)->(%08x %d %p %p)
\n
"
,
This
,
grfBSCF
,
dwSize
,
pformatetc
,
pstgmed
);
if
(
This
->
nslistener
)
{
if
(
!
This
->
nsstream
)
{
if
(
!
This
->
nsstream
)
This
->
nsstream
=
create_nsprotocol_stream
(
pstgmed
->
u
.
pstm
);
nsres
=
nsIStreamListener_OnStartRequest
(
This
->
nslistener
,
(
nsIRequest
*
)
NSCHANNEL
(
This
->
nschannel
),
This
->
nscontext
);
if
(
NS_FAILED
(
nsres
))
FIXME
(
"OnStartRequest failed: %08x
\n
"
,
nsres
);
}
do
{
hres
=
IStream_Read
(
pstgmed
->
u
.
pstm
,
This
->
nsstream
->
buf
,
sizeof
(
This
->
nsstream
->
buf
),
&
This
->
nsstream
->
buf_size
);
if
(
!
This
->
nsstream
->
buf_size
)
break
;
if
(
!
This
->
readed
&&
This
->
nsstream
->
buf_size
>=
2
&&
*
(
WORD
*
)
This
->
nsstream
->
buf
==
0xfeff
)
{
This
->
nschannel
->
charset
=
mshtml_alloc
(
sizeof
(
UTF16_STR
));
memcpy
(
This
->
nschannel
->
charset
,
UTF16_STR
,
sizeof
(
UTF16_STR
));
}
if
(
!
This
->
readed
)
{
nsres
=
nsIStreamListener_OnStartRequest
(
This
->
nslistener
,
(
nsIRequest
*
)
NSCHANNEL
(
This
->
nschannel
),
This
->
nscontext
);
if
(
NS_FAILED
(
nsres
))
FIXME
(
"OnStartRequest failed: %08x
\n
"
,
nsres
);
}
This
->
readed
+=
This
->
nsstream
->
buf_size
;
nsres
=
nsIStreamListener_OnDataAvailable
(
This
->
nslistener
,
(
nsIRequest
*
)
NSCHANNEL
(
This
->
nschannel
),
This
->
nscontext
,
NSINSTREAM
(
This
->
nsstream
),
This
->
readed
,
This
->
nsstream
->
buf_size
);
if
(
NS_FAILED
(
nsres
))
FIXME
(
"OnDataAvailable failed: %08x
\n
"
,
nsres
);
ERR
(
"OnDataAvailable failed: %08x
\n
"
,
nsres
);
if
(
This
->
nsstream
->
buf_size
)
FIXME
(
"buffer is not empty!
\n
"
);
This
->
readed
+=
This
->
nsstream
->
buf_size
;
}
while
(
hres
==
S_OK
);
}
else
{
BYTE
buf
[
1024
];
...
...
dlls/mshtml/nsio.c
View file @
58a261b7
...
...
@@ -221,6 +221,7 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface)
if
(
This
->
original_uri
)
nsIURI_Release
(
This
->
original_uri
);
mshtml_free
(
This
->
content
);
mshtml_free
(
This
->
charset
);
mshtml_free
(
This
);
}
...
...
@@ -512,11 +513,20 @@ static nsresult NSAPI nsChannel_GetContentCharset(nsIHttpChannel *iface,
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
aContentCharset
);
if
(
This
->
channel
)
return
nsIChannel_GetContentCharset
(
This
->
channel
,
aContentCharset
);
if
(
This
->
charset
)
{
nsACString_SetData
(
aContentCharset
,
This
->
charset
);
return
NS_OK
;
}
FIXME
(
"default action not implemented
\n
"
);
return
NS_ERROR_NOT_IMPLEMENTED
;
if
(
This
->
channel
)
{
nsresult
nsres
=
nsIChannel_GetContentCharset
(
This
->
channel
,
aContentCharset
);
const
char
*
ch
;
nsACString_GetData
(
aContentCharset
,
&
ch
,
NULL
);
return
nsres
;
}
nsACString_SetData
(
aContentCharset
,
""
);
return
NS_OK
;
}
static
nsresult
NSAPI
nsChannel_SetContentCharset
(
nsIHttpChannel
*
iface
,
...
...
@@ -1871,6 +1881,7 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
ret
->
notif_callback
=
NULL
;
ret
->
load_flags
=
0
;
ret
->
content
=
NULL
;
ret
->
charset
=
NULL
;
nsIURI_AddRef
(
aURI
);
ret
->
original_uri
=
aURI
;
...
...
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