I found a strange bug lately. I’m currently working on a website that I’m building Ajax in. Just to do some fancy shit, nothing special. But to my amazement I started getting a scripting error with the funny content ‘System error: -1072896658’.
Thank you Microsoft, for giving me that much information on what the f*ck is going on. Parden my french.
Took me a little of searching on the web to figure out that sometimes IE is trying to be smart. It will try to decode the character set of incomming data. Which means that if it can’t it will crash. 🙁
In my case this happened when calling the .responseText of the Ajax call. Appearantly my webserver didn’t include the charset by default. (Which is my fault as I configured it) But that shouldn’t be a problem. Except for IE that is!
Solving it is a lot easier though. Just set the charset in the response header. With PHP you can do this as follows:
header("Content-Type: text/html; charset=UTF-8");
That little line caused me hours of work! All thanks to the very vague messages of Microsoft.