Java/XSLT 字符编码
我正在使用 XSLT 来显示一些   (空格)和£ (£) 符号,但它们都显示为问号(无法识别的字符)。
我的编码在 HTML 中设置为 UTF-8,XSLT 标头看起来像这样
<xsl:stylesheet
version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml xsl">
<xsl:output method="xml" version="1.0" encoding="UTF-8" charset="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" indent="yes" omit-xml-declaration="yes" />
有人知道我哪里出错了吗?
非常感谢。
I am using XSLT to display some (space) and £ (£) signs but they all come out as question marks (unrecognised characters).
My encoding is set to UTF-8 in the HTML and the XSLT header looks like this
<xsl:stylesheet
version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml xsl">
<xsl:output method="xml" version="1.0" encoding="UTF-8" charset="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" indent="yes" omit-xml-declaration="yes" />
Does anyone have any ideas where I am going wrong?
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现我将内容类型设置为 text/html - 将其设置为 text/html;charset=utf-8 纠正了问题
I found that I was setting the content type to text/html - setting it to text/html;charset=utf-8 corrected the problem