title: Why am I getting an error trying to convert HTML toBinary in ColdFusion when a page is requested by IE6?
body: <p>I'm running ColdFusion on the backend and wrapping my pages like this:</p>
  
  <pre><code>    &lt;cfsavecontent variable="renderedResults"&gt;&lt;p&gt;hello&lt;/p&gt;&lt;/cfsavecontent&gt;
      &lt;cfscript&gt;
          compressedHTML = reReplace(renderedResults, "\&gt;\s+\&lt;", "&gt; &lt;", "ALL");
          compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(13), "ALL");
          compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(09), "ALL");
          variables.alredayBinary = "false";
      &lt;/cfscript&gt;
  
      &lt;cfif cgi.HTTP_ACCEPT_ENCODING contains "gzip"&gt;
         &lt;cfinvoke component="services.utils" method="gzip" stringToZip="#compressedHTML#" returnvariable="compressedHTML"&gt;&lt;/cfinvoke&gt;    
         &lt;cfheader name="Content-Encoding" value="gzip"&gt;
         &lt;cfset variables.alredayBinary = "true"&gt;
      &lt;/cfif&gt;
  
      &lt;cfheader name="Content-Type" value="text/html; charset=ISO-8859-1"&gt;
      &lt;cfheader name="Content-Length" value="#len(compressedHTML)#" &gt;
  
      &lt;cfif variables.alredayBinary EQ "false"&gt;
          &lt;cfcontent reset="no" variable="#ToBinary(compressedHTML)#" /&gt;
      &lt;cfelse&gt;
          &lt;cfcontent reset="no" variable="#compressedHTML#" /&gt;    
      &lt;/cfif&gt;
      &lt;cfreturn  /&gt; 
  </code></pre>
  
  <p>Although this makes sense to me and seems to work fine on latest browsers, I just had a user produce a flurry of error message using Internet Explorer 6. </p>
  
  <p>The message I'm getting is: </p>
  
  <pre><code> The parameter 1 of function ToBinary, which is now &lt;HTML STRING&gt; must be a Base-64 encoded string
  </code></pre>
  
  <p>which tells me, I'm ending up with <code>variables.alredayBinary = false</code> which should convert the HTML string into a binary encoded string. </p>
  
  <p><strong>Question:</strong><br>
  I'm not sure I understand what <code>toBinary</code> does. Isn't it just for that - taking HTML and converting it? So why the error? Why on IE6 only? I could only test IE8 which is working fine.</p>
  
  <p>Thanks for some hints!</p>