Strange behavior with CFCONTENT

Our app outputs reports in different formats - HTML, PDF, and TXT. I noticed a strange behavior recently.

In some cases the output looks like this.

Hey There

For the life of me I can’t figure this out. :flushed: This is code that has worked for years.

The above output is from simplified XSLT that just hardcodes the string “Hey There”. That’s what I would expect to see in the browser.

Here is the CFM that outputs the text.

<CFSET reportOutput = javaObject.getText()> <!--- Runs an XSLT transform using Xalan. --->
<CFHEADER NAME=Content-Disposition>
<CFCONTENT TYPE=text/plain;charset=ISO-8859-1 RESET=YES><CFOUTPUT>#reportOutput#</cfoutput>

Here is simplified XSLT:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:output method="text"/>
 <xsl:template match="/">
  <xsl:text>Hey There</xsl:text>
 </xsl:template>
</xsl:stylesheet>

There are two things that I notice between situations where it works and doesn’t. This strange behavior occurs with Windows 2022 Datacenter (not Standard) and Lucee 5.4.6.9. One site has Windows 2022 Standard and Lucee 5.4.3.2 and there is no problem.

Any ideas?

Thanks,
Mike

What are the charset settings looking like in the admin?

Looks like it’s windows-1252

I also noticed one other thing. On a working site with lucee 5.4.3.2 we didn’t install the xalan and xerces JARs. So, how can the app work with missing libraries. I believe xalan/xerces have been incorporated into Java 11. Normally, with Lucee 5.2, we install the JARs in the WEB-INF/lib.

So, I went to the other installation and removed the xalan/xerces JARs and restarted Lucee. It worked!

But, I’m not sure this is the proper fix. We know the version of xalan/xerces we’ve used for years is rock solid. I’m not sure what version has been migrated into Java 11.

I’d prefer to use the version we’ve always used until we can fully test.

I’d recommend trying upgrading to 6.2.1 and working the ant issues found, we’re here to help