Pluggable Protocol Handler and troubles with IE encoding

ahuaxz 2008-10-20 04:40:50
I'm writing proxy-like implementation of IE Pluggable Protocol Handler (for http, ftp), I have implemented IInternetProtocol and IInternetProtocolSink with simple logic, just creating through CoCreateClass instance of native protocol handler (reading its CLSID from registry) and passing all calls to it.

But I have strange problems with encoding. When I try to load page without META tag specified encoding in page body, however it is specified in HTTP headers (Content-Encoding header) Explorer resets page encoding to my system default codepage. When my pluggable protocol handler is switched off IE correctly gets codepage from header.

For example, if I try to load pages encoded in utf-8, but without tag <meta http-equiv="content-type" content="text/html; charset=UTF-8">, then I see page in my default encoding (windows-1251).

After all IE seems to lose original Content-Type header. Is there any way to correctly pass this header to underlying Protocol Handler?

Thanks for advice.
...全文
52 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧