首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何让XMLTransform()在使用IIS-10的Windows上处理ColdFusion2018上的UTF-8?

如何让XMLTransform()在使用IIS-10的Windows上处理ColdFusion2018上的UTF-8?
EN

Stack Overflow用户
提问于 2019-12-19 22:41:41
回答 1查看 61关注 0票数 0

下面是我的代码:

代码语言:javascript
复制
<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>

这是我的结果:

代码语言:javascript
复制
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?

EN

回答 1

Stack Overflow用户

发布于 2019-12-20 03:13:23

JAVA_TOOL_OPTIONS环境变量集添加到-Dfile.encoding=UTF8,然后重新启动CF修复了此问题:

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59411956

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档