简体   繁体   中英

Java/XSLT character encoding

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.

我发现我将内容类型设置为text / html-将其设置为text / html; charset = utf-8更正了该问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM