Technology Questions

Go Back   Technology Questions > Software Questions > Internet > Internet Explorer

Internet Explorer Discuss IE7 or any other IE version.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-06-2007, 08:04 AM
Alexander Zverev
Newsgroup Contributor
 
Posts: n/a
Pluggable Protocol Handler and trubles with IE encoding

Hello,



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).



In debugger I see:



STDMETHODIMP MyInternetProtocolImpl::Start(:, IInternetProtocolSink
__RPC_FAR *pOIProtSink, IInternetBindInfo __RPC_FAR *pOIBindInfo :)

{

BINDINFO biInfo;

memset(&biInfo,0,sizeof BINDINFO);

biInfo.cbSize = sizeof BINDINFO;

DWORD dwInfo;

pOIBindInfo->GetBindInfo(&dwInfo,&biInfo);



/// biInfo.dwCodePage == 1251. // from system defaults

:

// create our own instance of MyInternetProtocolSinkImpl and
pass pOIProtSink to it

}



And next point:



HRESULT STDMETHODCALLTYPE MyInternetProtocolSinkImpl::ReportProgress(ULONG
ulStatusCode, LPCWSTR lzStatusText )

{

:

if(ulStatusCode == BINDSTATUS_MIMETYPEAVAILABLE)

{

/// in this point lzStatusText == "text/html;
codepage=UTF-8" it's right!

return m_ProtocolSink->ReportProgress( ulStatusCode,
szStatusText );

/// m_ProtocolSink - is original
IInternetProtocolSink that was passed from Start()

}

}



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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 05-06-2007, 08:04 AM
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asynchronous pluggable protocol navigation fails in Vista IE7 Baker.Travis@gmail.com Internet Explorer 2 06-24-2008 05:20 PM
Asynchronous pluggable protocol navigation fails in Vista IE7 Baker.Travis@gmail.com Windows Vista 2 06-24-2008 05:10 PM
How to write a HTTP protocol handler? Kiran Kumar Internet Explorer 0 04-12-2008 06:40 AM
Javascript causes Asynchronous Pluggable Protocol to break Bach Le Internet Explorer 0 03-14-2008 10:50 AM
Protocol handler different than XP? Mesan Windows Vista 3 08-15-2007 09:40 PM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 11:29 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0