下面是我的代码:
<cfset myXML = '<?xml version="1.0" encoding="UTF-8"?><foo>I’m coming from the XML.</foo>'>
<cfsavecontent variable="myXSL"><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<output>
I’m coming from the XSLT.
<xsl:apply-templates />
</output>
</xsl:template>
</xsl:stylesheet>
</cfsavecontent>
<cfset result = XMLTransform(myXML, myXSL)>
<cfoutput>#result#</cfoutput>这是我的结果:
I’m coming from the XSLT. I’m coming from the XML.我在装有IIS-10的Windows上运行CF2018。这可能是一个IIS-10问题,因为我已经在Mac/Apache设置上尝试了相同的代码,并且它在那里工作得很好。如果这就是问题所在,如何让IIS-10对XML和XSLT文件使用UTF-8?
发布于 2019-12-20 03:13:23
将JAVA_TOOL_OPTIONS环境变量集添加到-Dfile.encoding=UTF8,然后重新启动CF修复了此问题:

https://stackoverflow.com/questions/59411956
复制相似问题