首页 > 解决方案 > 编码问题,UTF8

问题描述

无法表示双波浪号,即U+0360;

我有一个巨大的 .xml 文件,其中包含用 UTF8 编写的文本。文本里面有很多双波浪线。UTF8 图表中的双波浪号由◌͠◌表示。在 Oxygen 中,一切正常,我可以看到带有双波浪号的字符,使用 DejaVu Sans。问题始于转换场景。我将输出的编码声明为 UTF-8,.xml 文件本身就是 UTF-8,

但尽管如此,转换场景以下列方式返回文本ⴉ͠x - 即第一个字母被块替换。我尝试了在文本中表示双波浪号的不同选项,即我尝试在 .xml 中将其替换为 ͠ ( ͠) 或Ũ ( ) Ũ,但结果相同,即块 ⴉ͠x。

.xml 文件中的 unicode 声明:

---
<?xml version="1.0" encoding="UTF-8"?> 
---

.xsl 文件中的 unicode 声明:

---
<xsl:output method="html" encoding="UTF-8"/>
---

预期结果是字母 + 波浪号 + 字母。

xslt 文件以以下内容开头:

It starts with the following:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"                  
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:teix="http://www.tei-c.org/ns/Examples"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="#all" version="2.0">
<xsl:import href="../common/common.xsl"/>
<xsl:import href="../common/verbatim.xsl"/>
<xsl:import href="html_param.xsl"/>

标签: xmlxhtmlxslt-1.0

解决方案


推荐阅读