Google Base RSS feed 中的连字符编码(减号)
我正在尝试创建自动提要生成,以便使用 utf-8 编码将数据发送到 Google Base。 但是,每当发现连字符告诉我相关属性(标题、描述、产品类型)中存在编码错误时,我就会收到错误。我目前正在使用:
−
但我也尝试过:
−
两者都不起作用。 我在文档顶部使用以下声明:
<?xml version="1.0" encoding="utf-8"?>
好的,为了提供更多上下文,数据是从我们网站的产品信息中提取的,该产品信息以 utf-8 编码数据存储在 MYSQL 数据库中。数据将使用一些标准 RSS 属性以及一些自定义的 Google 属性进入 RSS 2.0 提要。每当除链接字段之外的任何字段中存在连字符时,就会出现问题。因此它出现在标题和描述字段以及自定义产品类型字段中。以下是 Google Base(商家中心)抛出错误的字段示例。无论有或没有其他实体,它都会引发相同的错误,并且只有在删除连字符时才会停止反对。
<description><p>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.</p>
<p>Solid hardwood sports floors are designated as "area elastic floors" 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.</p>
<p>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</p>
<p>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.</p>
<p>A higher more demanding standard for better quality sports and dance flooring is DIN 18032 Part 2</p>
<p>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.</p>
<p>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.</p></description>
I am trying to create an automatic feed generation for data to be sent to Google Base using utf-8 encoding.
However I am getting errors whenever hyphens are found telling me that there is an encoding error in the relevant attribute (title, description, product_type). I am currently using:
−
but I have also tried:
−
neither of which have worked.
I am using the following declaration at the top of the document:
<?xml version="1.0" encoding="utf-8"?>
Ok to give further context to this the data is being pulled from our site's product information stored as utf-8 encoded data in a MYSQL database. The data is going into an RSS 2.0 feed, using the some standard RSS attributes as well as some custom defined Google attributes. The problem comes up whenever there is a hyphen in any field except the link field. So it is appearing in the title and description fields as well as the custom product_type field. Below is an example of a field that Google Base (merchant centre) throws an error over. It throws the same error with or without the other entities and only stops objecting when hyphens are removed.
<description><p>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.</p>
<p>Solid hardwood sports floors are designated as "area elastic floors" 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.</p>
<p>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</p>
<p>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.</p>
<p>A higher more demanding standard for better quality sports and dance flooring is DIN 18032 Part 2</p>
<p>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.</p>
<p>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.</p></description>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您谈论使用连字符,但您尝试插入的字符是数学减号。您是否尝试过使用实际的连字符?也不是 HTML 实体;只是字符,
-
。You talk about using hyphens, but the character you're trying to insert is the mathematical minus sign. Have you tried it with an actual hyphen? And not a HTML entity, either; just the character,
-
.