yoy.be "Why-o-Why"

UTF encoding over your IInternetProtocol implementation (encoding, charset? none of such!)

2007-07-05 12:12  i1237  coding  [permalink]

Aah, doesn't it feel good you finally found what you've been searching for such a long time. A few hours, days, weeks...

I noticed IE was showing the pages it got over my [[Asynchronous Pluggable Protocol Handler]] in the default windows encoding. Though I was taking care that everything was coming out nicely in correct UTF-8.

I tried putting "text/html; charset=utf-8" in as mime-type but that doesn't work.

I was looking into IInternetProtocolInfo to see if IE calls that one to get more info on the encoding, it doesn't...

So it was time to google, and it's always good to see you're not alone:
http://groups.google.com/groups?hl=nl&ie=ISO-8859-1&q=iinternetprotocol+encoding&lr=&oe=ISO-8859-1&um=1&sa=N&tab=wg

But still those don't hold the answer also, so the search went on. Until for another project I solved an encoding problem by ensuring the UTF Byte Order Mark is at the beginning of each file. Before that I didn't really know UTF-8 had a BOM also! I had noticed the 'ÿ»¿' characters from time to time when encoding was wrong, but had the luxury of being able to ignore those.

So, to get the 'auto-detect' encoding in IE right, start sending by sending the Byte Order Mark of UTF-8 or UTF-16 first!

http://en.wikipedia.org/wiki/Byte_Order_Mark


twitter reddit linkedin facebook