IE client side Javascript and htc inclusion problem...

Today we had the strangest problem wit a piece of javascript that was including a htc as follows:

<html xmlns:xp>
 <head>
  <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
  <link type="text/css" rel="stylesheet" href="skins/quicktime/skin.css">
  <link type="text/css" rel="stylesheet" href="container.css">
  <?import namespace="xp" implementation="xpc.button.htc">
  <?import namespace="xp" implementation="xpc.gallery.htc">
  <?import namespace="xp" implementation="xpc.moduledef.htc">
  <?import namespace="xp" implementation="xpc.module.htc">
  <?import namespace="xp" implementation="xpc.panel.htc">
   :

In our test code, a html file containing the above code, everything worked just fine. Time to integrate in our server side code!

After integration we were getting a strange error message about a missing object. After hours of debugging and creating completely similar minimal files with one derived from out test html file and one derived from our server generated code we were clueless.

Time for WinDiff, and to our surprise the server generated file started with four strange characters!

The problem was that the htc files and test html file are all in ANSI, while the server generated code is UTF-8. Problems occur when you import htc files in ANSI format in a UTF8 format html file!!!

 

1 Comment

Comments have been disabled for this content.