Utf 8 GoogleBase RSS源中的连字符编码(减号)

Utf 8 GoogleBase RSS源中的连字符编码(减号),utf-8,rss,character-encoding,google-base,Utf 8,Rss,Character Encoding,Google Base,我正在尝试创建一个自动feed生成,用于使用utf-8编码将数据发送到GoogleBase。 但是,每当发现连字符告诉我相关属性(标题、说明、产品类型)中存在编码错误时,我就会出错。我目前正在使用: &amp;minus; 但我也尝试过: &amp;#8722; 两者都不起作用。 我在文件顶部使用以下声明: <?xml version="1.0" encoding="utf-8"?> 好的,让我们进一步解释一下,数据是从我们网站的产品信息中提取出来的,这些信

我正在尝试创建一个自动feed生成,用于使用utf-8编码将数据发送到GoogleBase。 但是,每当发现连字符告诉我相关属性(标题、说明、产品类型)中存在编码错误时,我就会出错。我目前正在使用:

&amp;minus;
但我也尝试过:

&amp;#8722;
两者都不起作用。 我在文件顶部使用以下声明:

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

好的,让我们进一步解释一下,数据是从我们网站的产品信息中提取出来的,这些信息作为utf-8编码的数据存储在MYSQL数据库中。数据将使用一些标准的RSS属性以及一些自定义的Google属性进入RSS2.0提要。每当除链接字段外的任何字段中出现连字符时,就会出现此问题。因此,它出现在标题和描述字段以及自定义产品类型字段中。下面是GoogleBase(商户中心)抛出错误的字段示例。它在有或没有其他实体的情况下抛出相同的错误,并且仅在删除连字符时停止反对

    <description>&lt;p&gt;Your sports floor is designed primarily for sports use. Thou many facilities have to be used for other activities including things like; assemblies careers fairs drama parties and social events bring and buy sales exhibitions etc.&lt;/p&gt;

&lt;p&gt;Solid hardwood sports floors are designated as &quot;area elastic floors&quot; to provide the spring resilience and shock absorbing qualities needed for sports and dance use to minimise injury. If the floor is too hard the athlete and user will be exposed to early fatigue and aching joints through to injury such as sprains joint and shin bone damage.&lt;/p&gt;

&lt;p&gt;If too soft then ball bounce and running characteristics are compromised.
In the UK hardwood sports floors are governed by a number of recognised standards&lt;/p&gt;

&lt;p&gt;All sports floors must conform to BS7044 Part 4 - this is the minimum Sport England requirement with which your floor msut comply if it is part of a Sport England sponsored project.&lt;/p&gt;

&lt;p&gt;A higher more demanding standard for better quality sports and dance flooring is DIN 18032 Part 2&lt;/p&gt;

&lt;p&gt;The newest - and the best - standard is the European Standard CEN 217. This standard has brought together all the best eprformance criteria from a number of current standards in the EU including BS and DIN.&lt;/p&gt;

&lt;p&gt;All Junckers systems fully comply with one or more of these standards. They ALL comply with the minimum Sport England requirement of BS7044 Part 4 compliance.&lt;/p&gt;</description>
p我们的运动地板主要设计用于运动用途。许多设施必须用于其他活动,包括:;集会、职业博览会、戏剧派对和社交活动带来并购买销售展览等。/p
pSolid硬木运动地板被指定为“区域弹性地板”,以提供运动和舞蹈使用所需的弹性和减震性能,从而将伤害降至最低。如果地板太硬,运动员和使用者将暴露在早期疲劳和关节疼痛中,直至受伤,如扭伤关节和胫骨损伤。/p
pIf太软,则球反弹和跑动特性受损。
在英国,硬木运动地板由许多公认的标准/p管理
pAll运动地板必须符合BS7044第4部分-这是英格兰运动会的最低要求,如果是英格兰运动会赞助项目的一部分,您的地板msut必须遵守。/p
pA DIN 18032第2/p部分为更高更高要求的标准,以获得更高质量的运动和舞蹈地板
p最新也是最好的标准是欧洲标准CEN 217。本标准汇集了欧盟许多现行标准(包括BS和DIN)中的所有最佳电子性能标准。/p
pAll Junckers系统完全符合其中一项或多项标准。它们都符合BS7044第4部分的英国体育最低要求。/p

您谈到使用连字符,但您试图插入的字符是数学减号。你试过用连字符吗?也不是HTML实体;只是角色,
-

对不起,我也试着澄清一下­;和&ndash;是的,原始数据只有字符,没有html实体,这就是问题的根源。数据也来自utf-8源。是的,如果减号不起作用,我认为软连字符或短划线也会引起问题。但是你有没有试着用一个普通的旧破折号(即大多数英语键盘上零右边的字符)来替换那里的任何东西?是的,这就是它最初的样子,但我试着用它来替换显示的字符,只是为了看一下,我还是遇到了同样的问题。嗯,我不明白ASCII连字符是如何导致编码相关错误的。它到底是如何使用的?请编辑您的问题并添加更多的上下文。更新了一些上下文信息,希望这有助于更好地解释它!谢谢